-
Notifications
You must be signed in to change notification settings - Fork 3
Typora Snap takes a very long time to start the first time since PC boot #1
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
Comments
It's a confined electron app. Some slowness is expected on first start while environment is being setup. With that said, I'm getting about 5s for first and 2s for second startup. I think it can be improved to 2s first and 1s second startup using I'll do some more testing and offer a PR. |
You can try adding the following config option to increase startup speed. I believe (but am not 100% sure) that xz is still the default compression format. See https://snapcraft.io/blog/why-lzo-was-chosen-as-the-new-compression-method for more details. compression: lzo |
First, I have found a script to more accurately test launch times. This is for X, I don't know what Wayland equivalent would look like. #!/bin/bash
function close-window {
for window in $(xdotool search --sync --onlyvisible --class "$1"); do
xdotool getwindowpid "$window" | xargs kill;
done
}
close-window "$1" & time snap run "$1" Here are median launch times vs. compression for current snap (in seconds, depends on hardware):
These times are same for previous core20 and current core22 snap. Snap compression only affects first lauch while SquasFS is being unpacked. Most snap maintainers, if not all, have opted to ignore the default space saving option https://forum.snapcraft.io/t/an-investigation-into-snap-startup-speed/14619 Checking connected interfaces in wrapper script takes 0.077s. Then I started working on core24 and looking into GPU acceleration. There are GPU content snaps being developed with drivers and wrappers in them. These are auto-connected in gnome extension for core24 snaps providing out-of-box GPU acceleration. https://mir-server.io/docs/the-gpu-2404-snap-interface Here is nvtop showing Typora GPU usage. Median launch times for core24 was 1.079s for 5 launches. Looks like, time saved by removing wrapper script is spent on other wrapper scripts provided by gnome extension, remaining same in the end. Some additional stuff:
I have opened a pull request with all these improvements. May I also suggest a small testing period in candidate channel. |
Another command to observe environment being setup is: snap run --trace-exec typora It's output looks like this (removed standard application output):
|
Typora Snap version: v1.9.3
When starting Typora Snap for the first time since PC boot, it takes a very long time to start (about 10 seconds).
This only happens with the Snap version.
The text was updated successfully, but these errors were encountered: