Skip to content

Library makes the program slow #84

@matronator

Description

@matronator

System (please complete the following information):

  • OS: macOS
  • GO Version: 14.3.1
  • Pkg Version: 1.5.4

ENV info on the terminal (by command env | grep -i TERM)

TERM=xterm-256color
TERMINAL_EMULATOR=JetBrains-JediTerm
TERM_SESSION_ID=xxx

Describe the bug

When using this library for printing messages, the program runs noticeably slower than when using just fmt.Print.

To Reproduce

entries := map[string]string{
	"test": "fest",
	"rest": "best",
}

i := 1

yellow := color.FgGreen.Render

for k := range entries {
	_, err := fmt.Println(yellow(strconv.Itoa(i)+". ", k))

	if err != nil {
		color.Errorln(err)
	}

	i++
}

Expected behavior

To run at similar speed compared to using the fmt package.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions