Speed up SetContent by checking length of combining characters before reflect.DeepEqual #744
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adding these length checks before the
reflect.DeepEqual
speeds up SetContent when not drawing Unicode combining charactersWith
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)
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