Closed vladh closed 2 months ago
you ask to draw as fast as you can so everything works as expected. If you want to throttle drawing, use pre_present_notify
(all of that is mentioned in docs).
Keep in mind here, the pre_present_notify
will only work if you do the drawing, if you don't ever do that it's pretty much useless and won't change anything.
The default window.rs
example does things pretty much as they should and draws with the display refresh rate, etc, etc.
Description
I'm using iced and encountering very high GPU usage in all use cases, on Wayland only. (https://github.com/iced-rs/iced/issues/2558)
I'm testing whether winit is the cause of the issue. I'm using the following Hello World program:
Running this on my system causes very high CPU usage:
My understanding is that this shouldn't happen with
ControlFlow::Wait
.The CPU usage drops to ~0% if I remove this line:
Printing the events received shows constant
RedrawRequested
events — 76,000 events per second.Do you have any pointers about how I might continue debugging this? I'm happy to put in more work, but am a bit stumped right now.
Debugging output
No response
Window isn't shown unless you draw
Winit version
0.30.5