-
Notifications
You must be signed in to change notification settings - Fork 187
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
[GuiAdvancedScrollText] Performance improvements #2019
Merged
daid
merged 11 commits into
daid:master
from
csibbitt:csibbitt-guiadvancedscrolltext-performance-tweak
Oct 16, 2023
Merged
[GuiAdvancedScrollText] Performance improvements #2019
daid
merged 11 commits into
daid:master
from
csibbitt:csibbitt-guiadvancedscrolltext-performance-tweak
Oct 16, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Prepare fonts for entries only when adding an entry, rather than for every entry on every frame.
Re-prep fonts to reflow and recalculate entry height when the window width changes. This causes significant performance impacts when resizing the window with a large log.
* Refactored Entry font prep and max prefix tracking to its own method * Added a map for tracking prefix lengths * When removing Entries, update max_prefix_width if necesarry * Reset max_prefix_width (and tracking map) when resizing or clearing Entries
* Needs to account for draw_offset alignment kludge
daid
reviewed
Oct 11, 2023
Tsht
pushed a commit
to Tsht/EmptyEpsilon
that referenced
this pull request
Nov 22, 2023
* [GuiAdvancedScrollText] Move prefix width calculation to addEntry * [GuiAdvancedScrollText] Disregard text that would be drawn below rect * [GuiAdvancedScrollText] Use unsigned ints for indexes * [GuiAdvancedScrollText] Move font prep from onDraw to addEntry Prepare fonts for entries only when adding an entry, rather than for every entry on every frame. * [GuiAdvancedScrollText] Re-prep fonts when window width changes Re-prep fonts to reflow and recalculate entry height when the window width changes. This causes significant performance impacts when resizing the window with a large log. * [GuiAdvancedScrollText] Track max_prefix_width when adding/removing * Refactored Entry font prep and max prefix tracking to its own method * Added a map for tracking prefix lengths * When removing Entries, update max_prefix_width if necesarry * Reset max_prefix_width (and tracking map) when resizing or clearing Entries * [GuiAdvancedScrollText] Fix the latest-line view on Relay startup * Needs to account for draw_offset alignment kludge * [GuiAdvancedScrollText][NO-OP] Simplify prepEntry signature * [GuiAdvancedScrollText] Fix bounds check in removeEntry * [GuiAdvancedScrollText] Revert to signed ints for indexes --------- Co-authored-by: oznogon <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes Issue #1939
Most of the work is from @oznogon , I just added some finishing touches.
This refactors GuiAdvancedScrollText to improve render performance.
Testing on a variety of systems with a 10,000-entry log, this maintains:
Known issues: