Tigz
Parallel gzip decompression and compression using libdeflate and rapidgzip.
Install / Use
/learn @tmaklin/TigzREADME
tigz
Parallel gzip compression and decompression with
- libdeflate by Eric Biggers for compression.
- rapidgzip by Maximilian Knespel for decompression.
- zlib-ng by zlib-ng as the rapidgzip backend.
Installation
Compile from source
Requirements
- A compiler with C++17 support.
- cmake >= v3.16.
Dependencies
tigz additionally downloads, or requires, the following dependencies when cmake is called
Compiling
Clone the repository, enter the directory, and run
mkdir build
cd build
cmake ..
make -j
This will create the tigz executable in the build/bin directory.
Optinally, use make install afterwards to install tigz. The
installation path can be modified by passing
-DCMAKE_INSTALL_PREFIX=/path/to/install/tigz/in to cmake.
Extra compiler flags
- Native CPU instructions:
-DCMAKE_WITH_NATIVE_INSTRUCTIONS=1 - Link-time optimization:
-DCMAKE_WITH_FLTO=1
Using system libraries
System zlib or libdeflate libraries can be supplied by specifying the path to the library files and the header files with
cmake -DCMAKE_ZLIB_LIBRARY=/path/to/libz.so -DCMAKE_LIBDEFLATE_LIBRARY=/path/to/libdeflate.so \\
-DCMAKE_ZLIB_HEADERS=/path/to/zlib.h -DCMAKE_LIBDEFLATE_HEADERS=/path/to/libdeflate.h
Preinstalled rapidgzip, BS::thread_pool, or cxxopts headers may be supplied similarly via cmake. These are header-only libraries so the library path is not needed.
Usage
As an executable
tigz has the same command-line interface as gzip, bzip2, xz, etc. do. tigz accepts the following flags
tigz [options] [files]
-1 ... -12 Compression level. (default: 6)
-z, --compress Compress file(s).
-d, --decompress Decompress file(s).
-k, --keep Keep input file(s) instead of deleting.
-f, --force Force overwrite output file(s).
-c, --stdout Write to standard out, keep files.
-T, --threads arg Use `arg` threads, 0 = all available. (default: 1)
-b, --block-size arg i/o buffer sizes per thread in KiB. (default: 128)
-h, --help Print this message and quit.
-V, --version Print the version and quit.
As a library
Note: the API is experimental until v1.x.y is released.
tigz can be used as a header-only library. Include the tigz_decompressor.hpp or tigz_compressor.hpp files in your project and create the appropriate class in your code.
You will need to supply the dependency headers and link your program with zlib and libdeflate for tigz to work. Cmake can be used to configure the project automatically as part of a larger build.
License
tigz is licensed under the BSD-3-Clause license. A copy of the license is supplied with the project, or can alternatively be obtained from https://opensource.org/licenses/BSD-3-Clause.
Dependencies
- libdeflate is licensed under the MIT license.
- rapidgzip is dual-licensed under the MIT license or the Apache 2.0 license.
- zlib-ng is licensed under the zlib license.
- BS::thread_pool is licensed under the MIT license.
- cxxopts is licensed under the MIT license.
Related Skills
node-connect
343.1kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
90.0kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
343.1kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
343.1kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
