Open mh3663 opened 2 years ago
Thanks for bringing this up!
I'm guessing this problem stems from either the winit crate (which pulls in mio) or glutin. I'm planning on doing some dependency reduction, and switch out winit for something that provides native headerbars (removing mio), as well as swap glutin for wgpu and that should fix the problem.
I think it's an inefficient immediate mode thing, where it has to draw every frame.
Having been curious as to why task switching from/to alloy and resizing of alloy windows seem so choppy, I instinctively did an »strace alloy 1.png« (1.png is one of the small images in alloy's resource directory making up its UI), which causes a constant flood of messages, seemingly without any intermittent delays.
All those rapid syscalls also explain the 1.5% CPU load with any open alloy window (emulsion too, both debug and release build). I did it on Linux (Kernel 5.18.1; on the same machine, gwenview, eog and feh use 0% CPU and radio silent on strace -- except when animating GIFs, which is fair).
Just 2 snippets of a typical alloy strace:
...and other times, like this:
Edited to add: I like pure image viewers like alloy as well as the fact that alloy is written in Rust. I have been unable to localize those incessant syscalls above, though. They don't seem to reside in any of the alloy or emulsion source files but rather in one of those uncounted Cargo dependencies.
I wouldn't be surprised if a multithreading-nonblocking messaging-I/O library like Tokio was the cause.