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

Speed up SetContent by checking length of combining characters before reflect.DeepEqual #744

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

kivattt
Copy link

@kivattt kivattt commented Jul 26, 2024

Adding these length checks before the reflect.DeepEqual speeds up SetContent when not drawing Unicode combining characters

With xset r rate 300 255 (key repeating 255 times per second), I recorded myself scrolling through 2000 files in my file manager project where I'm using tview with and without (left) this change:

tcell_change.mp4

(6x sped up)

image

I believe the performance difference is a lot less dramatic for most projects, since in this old version of my file manager the screen was always unnecessarily being cleared with Box.DrawForSubclass() in tview

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant