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
igzip
is 3x faster in decompressing that zlib-ng (6x than zlib)
#986
Comments
zlib-ng doesn't try to be fastest... It does however include a lot of intrinsic functions to speed up things but doesn't contain hand-written assembly. Some C compilers can't handle inline assembly so separate assembler is required for supporting hand-written assembly. |
As @sebpop has noted, a less efficient compression may lead to a file that is faster and easier to decompress. To compare decompression between tools, all tools should contribute to a corpus of compressed files and then each tool is timed while decompressing this common set of files. I used this script to compare igzip on an AMD 3900X. igzip's compression is fast but generates large files (see figure). When decompression is compared in a fair test, it is faster than zlib-ng, somewhat faster than libdeflate (which tends to have higher memory demands). For completeness, I also tested AArch64 binaries on an ARM-based Apple M1, where igzip and zlib-ng performed similarly (~284 mb/s) while libdeflate was faster (341 mb/s). igzip only supports compression levels 0..3, so it is not a drop-in replacement for scripts that expect gzip to support levels 1..9 (specifying a level greater than 3 results in a
To try this yourself, you just need to install igzip on your computer and append one line of code around line 369:
|
It's not fair to compare zlib-ng+pigz combination if others are executed directly.... zlib-ng is only fast when it is given large enough buffer in memory and any disk I/O is avoided... Until today there was known issue with pigz and zlib-ng which did result in skewed results and possible data corruption. |
https://github.com/intel/isa-l/blob/ebb78fc99ef7247bd9c16cecf7faa248563ce4f6/programs/igzip_cli.c#L65 Also |
@nmoinvaz you are correct that igzip can use multiple threads (e.g. @mtl1979 I did test on a RAM disk to minimize disk I/O. I notice that minigzip.c defines a 16kb/48kb read/write buffer size. Perhaps we could allow the user to specify this from the command line, which might improve performance and remove this source of variability when comparing to other tools. |
For me the most appealing part of igzip is the decompression speed. (compression speed is fast too, but compression ratio suffers of course). Probably I compiled igzip wrong, but specifying |
igzip
is 3x faster in decompressing that zlib-ng (6x than zlib).https://github.com/intel/isa-l/tree/master/igzip
The text was updated successfully, but these errors were encountered: