This repo contains a C++ port of gunzip for decompression of .gz
files. By default, it relies on Fast CRC32 for CRC32 computation but can be switched to use zlib instead.
Below shows runtime comparison with other C/C++ gunzip implementations.
# Threads | GNU Gzip | Pigz | This |
---|---|---|---|
1 | 4.93 | 3.26 | 2.81 |
2 | - | 2.35 | 1.87 |
# Threads | GNU Gzip | Pigz | This |
---|---|---|---|
1 | 7.19 | 2.64 | 3.44 |
2 | - | 2.78 | 2.89 |
# Linux
$ cmake -Bbuild -DCMAKE_CXX_FLAGS="-O3 -g -DNDEBUG"
# macOS
$ cmake -Bbuild -DCMAKE_CXX_FLAGS="-O3 -g -DNDEBUG -Wl,-ld_classic -D__BYTE_ORDER=1234" -DCMAKE_CXX_COMPILER=g++-13
$ make -Cbuild -j
# single thread
$ build/gunzip < compressed.gz > decompressed
# two threads
$ build/gunzip -t < compressed.gz > decompressed