Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Library makes the program slow #84

Open
matronator opened this issue Feb 28, 2024 · 0 comments
Open

Library makes the program slow #84

matronator opened this issue Feb 28, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@matronator
Copy link

matronator commented Feb 28, 2024

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.

@inhere inhere added enhancement New feature or request good first issue Good for newcomers labels Feb 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants