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

Support zstd compression #10

Merged
merged 1 commit into from
Feb 14, 2025
Merged

Support zstd compression #10

merged 1 commit into from
Feb 14, 2025

Conversation

cuklev
Copy link
Contributor

@cuklev cuklev commented Feb 14, 2025

I hardcoded compression level 10. On my system it compresses the initramfs I generated under a second.

Numbers from my testing:

  • ugrd.cpio is 20MB
  • ugrd.cpio.xz is 6.2MB
    • Compression takes 14s
    • Decompression takes 0.5s
  • ugrd.cpio.zst is 7.5MB
    • Compress takes 0.88s
    • Decompression takes 0.08s

I hardcoded compression level 10. On my system it compresses the
initramfs I generated under a second.

Numbers from my testing:
* ugrd.cpio is 20MB
* ugrd.cpio.xz is 6.2MB
  * Compression takes 14s
  * Decompression takes 0.5s
* ugrd.cpio.zst is 7.5MB
  * Compress takes 0.88s
  * Decompression takes 0.08s
@desultory
Copy link
Owner

Thank you!

I think I will add some tests for this. One thing I've been considering is how the compression level should be specified.

I tried to make the compression option somewhat open ended (despite being somewhat hardcoded for xz) and wasn't sure how to generalize compression levels for various algorithms.

@desultory desultory merged commit e4a0383 into desultory:main Feb 14, 2025
3 checks passed
@desultory
Copy link
Owner

#11

I added a compression level setting here, and tried to generalize the imports a bit more, with improved error messages on failed imports.

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

Successfully merging this pull request may close these issues.

2 participants