Replies: 5 comments 2 replies
-
I had posted some followups that I've deleted because I had a test app that reproduced the issue, but for a while I was seeing weird performance issues where even at 60fps it was randomly getting extremely long (230ms+) frames. And then in adding more info to the screen to try to figure that out, it randomly went away. My updated app to reproduce the issue shows an FPS counter, the last 60 frame times, and a rectangle animating sinusoidally up and down the right side of the screen. I'll post info on the dithering perf hit / puffin questions next...
|
Beta Was this translation helpful? Give feedback.
-
Here's a puffin view of it running without dithering. A few questions:
|
Beta Was this translation helpful? Give feedback.
-
More importantly, here's the puffin view of it running with dithering on. Note that the rendering still takes essentially zero time, but now swap_buffers just takes a lot longer, and this little baby app is capped at 35fps on the iMX8 just by turning dithering on. Still don't understand why the dithering pass would do this. I went to look at the code to see if maybe the |
Beta Was this translation helpful? Give feedback.
-
@emilk I guess my most basic suggestion here would just be that if new features are added that are controlled behind flags in NativeOptions or other construction structs, maybe to just default them to off and document them in the release notes? I still haven't dug in to understand exactly why dithering is hurting our perf this badly, but it wouldn't matter if it hadn't been added and silently turned on (the word "dither" doesn't occur in the 0.29 or 0.29.1 release notes) since it would have been opt-in. |
Beta Was this translation helpful? Give feedback.
-
The latter is important the the most likely explanation why you see strong hickups without dithering: Some frames you hit the screen's vblank and some you just miss it and thus skip a frame, meaning you have to wait for the next opportunity to present the frame (which is about every 16ms on a 60hz screen). -> Is triple buffering an option here (and can we even set this in the glow environment? is this something that is configurable? I haven't checked, personally I only ever worked with wgpu here). With triple buffered enabled, this would be less of an issue since frames can queue up to be shown onto the screen. The drawback is that this adds some latency. Which gets us to the much more interesting question of why this is costly enough to push us over to missing vblanks! So with the information at hand I'd conclude that, yes, this should have been better called out in the release notes! But I'd disagree that this should be an opt-in feature since for the vast majority of egui's usecases the perf impact of this isn't noticeable.
no clue about that part either |
Beta Was this translation helpful? Give feedback.
-
We updated from 0.28.1 to 0.29.1 a bit ago, and only noticed recently that it had dropped our framerate from a rock-solid 60fps to 35fps. This is especially odd because our display is 60Hz refresh so I'm not even sure where 35 is coming from, exactly.
Our app is compiled for an i.MX8 / ARM64 core computer, and we hadn't changed anything else.
I got puffin working (didn't even know it existed before this, btw, and it's really awesome to have a nice instrumenting profiler now, thanks!) and the change was almost entirely in swap_buffers - it shot from 9-10ms to 28+ms. When I see that I just assume it's vsync or some weird timing thing on the swap.
I finally just made an ultra-simple app from the egui "hello world" that just prints the framerate in big letters in the center of a fullscreen. undecorated window, and reproduced the issue. I binary-searched through egui commits, and the offender was this one that added a dithering pass and defaulted it to true:
b283b8a
I haven't dug in more, but I'm still not sure why that addition caused such a massive performance hit. Maybe it has to happen as a post-pass so it complicates the buffer swap timing or something? In any case, it remains the case that our entire render pass, in puffin, takes ~4-5ms tops on the i.MX8, so I just wanted to post this as an FYI that that dithering support can take a pretty straightforward app all of whose rendering completes fast enough to be rendering at 180fps, theoretically, and caps it at the strange number 35 on the i.MX8. Not sure why, not sure I'll investigate more, we don't need or want dithering anyhow so I'll probably just leave it off.
Beta Was this translation helpful? Give feedback.
All reactions