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

[GuiAdvancedScrollText] Large number of entries degrades render performance #1939

Open
oznogon opened this issue Mar 11, 2023 · 1 comment
Open

Comments

@oznogon
Copy link
Contributor

oznogon commented Mar 11, 2023

PR #1938 revealed that a GuiAdvancedScrollText element with a large-enough number of entries (ca. 1,000-1,500 in my testing) sees performance degrade dramatically.

For me, an expanded Ship's Log view dipped from 100+ fps at 100 entries to under 60 fps at 1,500, 30 fps at 3,000, 20 fps at 4,500, and 9 fps at 10,000.

Relay's single-line log preview wasn't affected, staying at 140+ fps even with rapid updates, so despite the other performance issues in #1938 this seemed isolated to the scrolling view.

@oznogon oznogon changed the title [GuiAdvancedScrollText] Large number of entries degrades performance [GuiAdvancedScrollText] Large number of entries degrades render performance Mar 11, 2023
@daid
Copy link
Owner

daid commented Mar 13, 2023

https://github.com/daid/EmptyEpsilon/blob/master/src/gui/gui2_advancedscrolltext.cpp#L45
Every time it draws it makes a preparedFontData for each prefix twice, and each entry once. With this many entries, this is a relative expensive function.

The "should I render this" check also only checks for one bound, not a upper and lower, so it's most likely rendering a lot of off-screen things as well.

I think there is room for quite a few simple optimizations there.

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

No branches or pull requests

2 participants