egui seems to be slower on macOS than on Windows
I have written a Desktop application using egui and compiled it for windows and macOS. On Windows, the application pops right up once the executable is launched, while on macOS it takes 1-2 seconds until the window appears (other threads are already running). Is this a known issue, can this be fixed?
I have tested it on Windows 10 native, Windows 10 in a virtual machine on my mac and on macOS 12.4. Since it is faster even on the virtual machine, I can exclude the performance difference of the hardware.
Note that the performance during operation is not significantly different (button clicking, plot updating etc) just the initial opening of the window takes longer.
On my mac everything pops up instantly.
- Does it matter what egui app you run? Does
hello_worldalso take two seconds? - Have you run it through a profiler?
- Does it change if you switch to the wgpu backend?
Thanks for the fast response!
No, it does not, even hello world run with the --release flag takes 2 seconds (also after closing the window it takes about 3 seconds until everything is saved and the process is finished)
I ran it using the Instruments profiler from Xcode - for that I had to install Xcode from the appstore - and now it opens instantly (as on windows) - the hello world as well as my bundled application... any ideas why? does Xcode include some linked libraries? I did not recompile anything!
I haven't tried to switch the wgpu backend (how would I do that?) and wouldn't that mean that a web-gui would be created instead of native?
Wow, so installing XCode fixed the startup lag for you? That's WILD.
You can try the wgpu renderer by enabling the wgpu feature of eframe: https://docs.rs/eframe/latest/eframe/#feature-flags
that's what I thought first.. but now (out of nowhere) the lag is back - I will look into this further, also on other mac machines. I'll keep you posted.
I'll close this, since it seems to be more machine-specific than egui specific. Haven't noticed the issue on other machines.