Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf: speed up SetColors by ~15-25% (#879)
The SetColors command was executing SetForegroundColor and then SetBackgroundColor, which writes 2 extra characters per cell compared to writing both colors in one command. This resulted in about 15-25% more FPS (19->24 fps) on a fullscreen (171x51) app that writes every cell with a different foreground and background color, compared to separately using the SetForegroundColor and SetBackgroundColor commands (iTerm2, M2 Macbook Pro). The app is the colors_rgb example in Ratatui, which writes every cell with a different foreground and background color in a loop. The CrosstermBackend was changed to use SetColors instead of SetForegroundColor and SetBackgroundColor.
- Loading branch information