-
Notifications
You must be signed in to change notification settings - Fork 526
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
Program takes a very long time to start (Linux, Wayland, Hyprland) #5337
Comments
Works-for-me(TM), which unfortunately also means I am not able to help very much:-( Can you run a profiler and check where it spends all the time? I guess it is waiting for something to time out before falling back to something that works. Hypraland is that wayland bling-thing, isn't it? I had some programs behave strangely on wayland before, maybe this is related. Check your environment and remove |
There are a couple of other things that you could try, which might help us narrow it down:
Thanks :) |
I generated perf.data (Renamed it to perf.txt). Flamegraph doesn't work for me for some reason, so here goes |
When DISPLAY is removed, everything stays the same, but when I remove WAYLAND_DISPLAY it starts up much faster. 2024-06-03.19-57-46.mp4 |
2024-06-03.20-10-49.mp4
2024-06-03.20-22-43.mp4 |
Fascinating. Thanks for the new update. Could you try But from this my money is on the GL driver being either slow to allocate or negotiate dri buffers - as opposed to the shm buffers used with software. Although Skia software should also be much faster then. |
No, starts up quite quickly, the window scales normally Debug info: debug1.txt 2024-06-03.21-06-06.mp4 |
I think this might not be related to Slint at all. |
No, even if I comment out all my logic, the program still starts after 15 seconds. |
Although I agree with you that you should put in a separate thread or use asynchronous functions. |
2024-06-04.01-22-08.mp4 |
The perf data as well as the wayland output suggest that the application is waiting for Hyprland to do something. The Slint side and your application is idle. Do you see CPU usage in Hyprland during this period of inactivity? |
Should also try to compare with one of the pure winit example. from the winit repository. |
After experimenting a bit, I discovered something interesting: |
Hello again, everyone. I think I've found what the problem with the long startup is. When developing a new project, I had everything running fine, but after adding a ComboBox widget I get a long launch 2024-07-01.20-48-44.mp4 |
@progzone122 you can try to enable debug logging. // main.rs
use log::LevelFilter;
use simple_logger::SimpleLogger;
fn main() {
SimpleLogger::new().with_level(LevelFilter::Debug).init().unwrap();
...
} And you could find then some helpful logs, especially you will see where your program freezes. If it won't help (because I debugged like this when I did |
Thanks, although I had no experience in debugging, I will try to provide more useful information |
Problem
It takes a very long time to start the program!
This should not be the case. Is this a bug or am I doing something wrong?
This happens in any project.
Example project: https://github.com/progzone122/micropad/tree/main/micropad_engine
2024-06-03.13-51-53.mp4
My PC info
The text was updated successfully, but these errors were encountered: