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

Question about the performances #9

Closed
wiz21b opened this issue Apr 14, 2023 · 2 comments
Closed

Question about the performances #9

wiz21b opened this issue Apr 14, 2023 · 2 comments

Comments

@wiz21b
Copy link

wiz21b commented Apr 14, 2023

Hello!

I've looked at your very nice memory editor demo today. I was a bit "surprised" by its runtime performance on my hardware (about 4ms out of the 16.6 available). Before rolling my own stuff, I wanted to ask you: did you optimize in way or another ? If so then well, I guess the performance are not bad and it's just the best one can do.

For example, do you redraw only the "visible" parts of the view or do you let egui do the clipping for you ?

Thank you !

@Hirtol
Copy link
Owner

Hirtol commented Apr 14, 2023

The list is implemented with a list-clipper, so only the memory visible on the screen is queried/rendered.

The run-time is unfortunately larger than I'd like. The biggest problem is the fact that we have to allocate a String for every single displayed byte (e.g 0xFF). Ideally this wouldn't be necessary as we could just create a lookup table to static Strings, but egui will then implicitly allocate a new String anyway due to its interface. See: emilk/egui#1098.

A few months back I tried allocating one single String per column group (usually 8 bytes). That improved performance significantly but suffered some issues with layout. In principle it should be possible to complete that work, although one would have to give up customizability of gaps between columns, as they would just be spaces/tabs at that point.

4ms does seem quite high though. For a full-screen 64 column ASCII enabled view it still only takes around 2 milliseconds per frame for me. Are you running in --release mode?

@wiz21b
Copy link
Author

wiz21b commented Apr 15, 2023

Definitely running in release mode. Read the results again, about 2.2msfor rendering 256 values on 16 columns. If I set it to 64 columns (1024 values), it reaches 6.1ms. Note my PC is pretty old (12 years +) and my graphics card is cheap. So that may just be the reason why it's slow :-/ I'll do a check with simple labels (I don't need the editor at the moment) and see how fast it goes. Thanks for spending some time answering my question !

@Hirtol Hirtol closed this as completed Apr 15, 2023
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