Open antonmedv opened 2 years ago
That's a great idea; we can totally optimize for that. Probably better than adding a new method would be for Render
to simply short circuit if the style only contains ANSI sequences (colors, bold, underline, etc).
This could be further optimized, but what about something roughly like this: https://github.com/charmbracelet/lipgloss/commit/d92e7196bc88063dd54f230d59fd0000638e038e? This will effectively exit the render early if there are only text colors and text styles to render.
I can try check this branch.
Seems better, but still:
Yeah, it’s an improvement but we can do better. Have some ideas, will look into this some more.
If you really just need colors, you could of course try and see how you fare with directly using termenv
here.
Hi,
I'm building a new tool that requires a lot of Render calls (right now I prerender every line for a viewbox). The cpu profile shows lipgloss.Render func is taking lots of time:
But I use only colors. Is it possible to add new methods, which allow to access only color functionality (no padding, borders, etc.)?
Thanks!