-
-
Notifications
You must be signed in to change notification settings - Fork 49
Regression? higher startup time with zstd compression #64
Description
I've been testing this appimagetool now that the static runtime is used automatically. I like that I can select the zstd compression level to use, however during testing I've noticed that appimages made with this appimagetool take longer to launch than appimages made with gzip compression.
For these benchmarks I've used the zen-browser appimage (the specific build, which targets x86_64 v3).
Using appimagetool I made two appimages, one using zstd level 22 compression (the highest):
./appimagetool-x86_64.AppImage --comp zstd --mksquashfs-opt -Xcompression-level --mksquashfs-opt 22 squashfs-root which results in an appimage size of 73.7 MiB
And another using level 1:
./appimagetool-x86_64.AppImage --comp zstd --mksquashfs-opt -Xcompression-level --mksquashfs-opt 1 squashfs-root which results in an appimage size of 96.0 MiB
And test it how long it took for each appimage to start, using this hacky script which gets when the application launches by checking the window class in i3wm: https://pastebin.com/qH7DwcQv
The appimages were all on placed on RAM before being launched to prevent the ssd causing any issue, here are the results:
Screenshot: https://imgur.com/xzMirgX.png
First this is how long it takes for the original appimage to start after 4 passes:
Time taken: 2359 miliseconds
Time taken: 2626 miliseconds
Time taken: 2257 miliseconds
Time taken: 2755 miliseconds
This is how long it takes for the zstd-22 appimage to start, which it is expected to be higher since it is using a very high compression level:
Time taken: 3534 miliseconds
Time taken: 3571 miliseconds
Time taken: 3688 miliseconds
Time taken: 3767 miliseconds
This is how long it takes with zstd-1, odd that it still takes longer than the original appimage:
Time taken: 2975 miliseconds
Time taken: 3116 miliseconds
Time taken: 2962 miliseconds
Time taken: 3130 miliseconds
Why I think that there is a regression, is that if we make the zstd squashfs image directly, and then add it to the runtime (bypass appimagetool all together) then, it only takes ~1.6 seconds to start the appimage as expected.
Time taken: 1603 miliseconds
Time taken: 1619 miliseconds
Time taken: 1596 miliseconds
Time taken: 1632 miliseconds
That "manual" appimage was made using mksquashfs ./squashfs-root Manual-zstd-1 -comp zstd -Xcompression-level 1 and then using the runtime from here I appended it with cat Manual-zstd-1 >> runtime-x86_64
I don't think this is an issue with the runtime, I don't know if the issue is that appimagetool is using different block sizes when making the squashfs image, there is a 1.4 MiB size difference between the manual-zstd1 appimage and the zstd1 appimage made with appimagetool.