-
Notifications
You must be signed in to change notification settings - Fork 2
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
Optimize for size #3
Comments
@probonopd |
Yes I think that would be a good improvement. |
@probonopd |
Thanks for the improvement @VHSgunzo. Maybe running https://github.com/RazrFalcon/cargo-bloat could help find what could be further optimized? Again, thanks for your efforts. I think that every KB that can be saved here will pay off when multiplied with the millions of downloads this might get over time. |
@probonopd This approach is chosen because there is no native library for DwarFS for rust. upd: I recently tried to reproduce this problem also with the latest version of the original AppImage runtime and got the same effect, the problem persisted. |
Do you optimize all of the embedded binaries with I don't think that Vulkan issues are caused by the runtime, more like by the contents of the AppImage (probably something is missing?) |
@probonopd
no, the same SquashFS image of container was used in all tests. Only when it is mounted with squashfuse, these problems do not occur. |
Now, that is really interesting! |
Probably almost all possible methods of size reduction have already been applied, unless i can also rebuild dwarfs-universal and all static libraries it depends on with the same size optimizations. And i can also try to remove support for some compression algorithms, though I wouldn't really want to cut functionality in this regard. |
At the moment, dwarfs-universal is taken from the builds of the official repository. |
For appimages the only two algos that are practical today are zstd and lz4 and I'm not very sure about lz4. There was also this similar change in EFI Zboot dropping all other compression algos and only keeping zstd and gzip. |
Unfortunately I noticed a big speed degradation of squashfuse built on musl libc, so I had to build it on glibc to prevent this. As a result, the uruntime size is a bit bloated. @probonopd |
Interesting observation @VHSgunzo. Do you have measurements? What kind of percentage are we talking about? I wonder whether Cosmopolitan or Chimera would perform better: |
the difference in my test was ~15% The image contains the container rootfs of the Arch Linux from lux-wine. The test consists of simply copying the contents of the mounted image to tmpfs (with pre-clearing of the page cache, dentries and inode cache).
I'd be interested in that too, but I haven't compared them yet |
I don't understand why it'd be relevant, fBSD utils are more bloated compared to Busybox, Toybox or Sbase. And Chimera is also Musl-based, just like Alpine. I don't think there will be any advantages to using a less-tested system, which is also unstable, and not prepared for containers. Of course, this is just my opinion, as someone who's daily driven FreeBSD, Alpine Linux (until recently) and Chimera. Actual testing should be done nonetheless |
Because chimera uses mimalloc: https://github.com/orgs/chimera-linux/discussions/2480 |
You can use jemalloc/mimalloc in Alpine, @probonopd is already compiling the programs we need in an Alpine CI, he'd have to add the jemalloc/mimalloc package and make all programs link with it. They can be statically linked or dynamically loaded |
I've been considering to rewrite the AppImage runtime in Rust for a while. Looks like you're faster! 👍
One question: Is here a way to optimize for binary size in Rust, so that we might get well under 1 MB?
The text was updated successfully, but these errors were encountered: