Skip to content
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

Faster startup using lz4? #19

Open
jb55 opened this issue May 3, 2017 · 11 comments
Open

Faster startup using lz4? #19

jb55 opened this issue May 3, 2017 · 11 comments

Comments

@jb55
Copy link

jb55 commented May 3, 2017

I think this would require a custom archiver that can bootstrap lz4 decompression

@probonopd
Copy link

@jb55 have you run benchmarks between squashfs and lz4? We'd be interested in those for AppImageKit, too.

@jb55
Copy link
Author

jb55 commented May 3, 2017

@probonopd I'm going off generic compression benchmarks where lz4 wins in speed by a large margin. I haven't tested lz4 in squashfs, although it looks like it's supported?

@probonopd
Copy link

You are right...

@domenkozar
Copy link

We did some measurements using gzip (instead of bzip) and the difference is not too big (a few percent quicker). Would be interesting to give lz4 also a try (but arx doesn't implement it).

@matthewbauer
Copy link
Member

Yeah I think biggest savings will come with "mounting" instead of "extracting". FUSE should give us that and I believe it's supported on most systems.

@cleverca22
Copy link
Collaborator

cleverca22 commented Mar 5, 2018

https://github.com/input-output-hk/daedalus/blob/10c9d349bcb964c0c5693a9bd484759d372b21f6/nix-bundle.nix#L63

over here, the bundle pre-unpacks the entire thing to a known directory, and generates things like a .desktop file
then when the user launches the application, its already unpacked, and the helper script just runs nix-user-chroot against the pre-unpacked dir

@jb55
Copy link
Author

jb55 commented Mar 5, 2018

@cleverca22 clever

@cleverca22
Copy link
Collaborator

but ive also ran into an issue, i'm treating the bundle purely as an installer/updater, but i cant run it from within the namespace for self-updating

@probonopd
Copy link

probonopd commented Mar 5, 2018

the bundle pre-unpacks the entire thing to a known directory

That will be much slower than loop-mounting using FUSE (as AppImage does), and will need additional space. Think about bundles that are GBs large.

@cleverca22
Copy link
Collaborator

yeah, depends on your use-case and how big things are

i also recently discovered pigz and pixz, which just perform gzip or xz across multiple cores, but the user would have to have them installed before arx could make use of it

@DavHau
Copy link
Member

DavHau commented Nov 16, 2020

According to multiple benchmarks online (like for example: https://www.rootusers.com/gzip-vs-bzip2-vs-xz-performance-comparison/), bzip2 seems to be significantly slower to unpack than gzip and lzma.

gzip would be the fastest but doesn't have good compression ratio.
In #69 I swapped out bzip2 with xz -1 which should improve upon compression/decompression speed and also file size.
Also it now uses all available cores for compression.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants