├── .github
├── dependabot.yml
└── workflows
│ ├── build_and_test.yml
│ └── publish.yml
├── .gitignore
├── CHANGELOG.md
├── Cargo.lock
├── Cargo.toml
├── LICENSE-MIT
├── README.md
├── THIRDPARTY.yml
├── UNLICENSE
├── bench-data
└── shakespeare.txt
├── bench2.sh
├── benchmark.sh
├── rust-toolchain.toml
└── src
└── main.rs
/.github/dependabot.yml:
--------------------------------------------------------------------------------
1 | # To get started with Dependabot version updates, you'll need to specify which
2 | # package ecosystems to update and where the package manifests are located.
3 | # Please see the documentation for all configuration options:
4 | # https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5 |
6 | version: 2
7 | updates:
8 | - package-ecosystem: "cargo" # See documentation for possible values
9 | directory: "/" # Location of package manifests
10 | schedule:
11 | interval: "weekly"
--------------------------------------------------------------------------------
/.github/workflows/build_and_test.yml:
--------------------------------------------------------------------------------
1 | name: Check
2 |
3 | on: [push, pull_request]
4 |
5 | env:
6 | CARGO_TERM_COLOR: always
7 |
8 | jobs:
9 | check:
10 | name: Check
11 | runs-on: ubuntu-latest
12 | steps:
13 | - name: Checkout sources
14 | uses: actions/checkout@v2
15 |
16 | - name: Install stable toolchain
17 | uses: actions-rs/toolchain@v1
18 | with:
19 | profile: minimal
20 | toolchain: stable
21 | override: false
22 |
23 | - name: Cache dependencies
24 | uses: Swatinem/rust-cache@v1
25 |
26 | - name: Run cargo check
27 | uses: actions-rs/cargo@v1
28 | with:
29 | command: check
30 |
31 | lints:
32 | name: Lints
33 | runs-on: ubuntu-latest
34 | steps:
35 | - name: Checkout sources
36 | uses: actions/checkout@v2
37 |
38 | - name: Install stable toolchain
39 | uses: actions-rs/toolchain@v1
40 | with:
41 | profile: minimal
42 | toolchain: stable
43 | override: false
44 | components: rustfmt, clippy
45 |
46 | - name: Cache dependencies
47 | uses: Swatinem/rust-cache@v1
48 |
49 | - name: Run cargo fmt
50 | uses: actions-rs/cargo@v1
51 | with:
52 | command: fmt
53 | args: --all -- --check
54 |
55 | - name: Run cargo clippy
56 | uses: actions-rs/cargo@v1
57 | with:
58 | command: clippy
59 | args: -- -D warnings
60 |
61 | test:
62 | name: Test Suite
63 | runs-on: ${{ matrix.os }}
64 | strategy:
65 | matrix:
66 | os: [ubuntu-latest, macOS-latest, windows-latest]
67 | steps:
68 | - name: Checkout sources
69 | uses: actions/checkout@v2
70 |
71 | - name: Install stable toolchain
72 | uses: actions-rs/toolchain@v1
73 | with:
74 | profile: minimal
75 | toolchain: stable
76 | override: false
77 |
78 | - name: Cache dependencies
79 | uses: Swatinem/rust-cache@v1
80 |
81 | - name: Run tests
82 | run: cargo test --verbose
83 |
--------------------------------------------------------------------------------
/.github/workflows/publish.yml:
--------------------------------------------------------------------------------
1 | name: Publish
2 |
3 | on:
4 | push:
5 | tags:
6 | - "*"
7 |
8 | jobs:
9 | publish:
10 | name: Publish for ${{ matrix.os }}
11 | runs-on: ${{ matrix.os }}
12 | strategy:
13 | matrix:
14 | include:
15 | - os: ubuntu-latest
16 | artifact_name: crabz
17 | asset_name: crabz-linux-amd64
18 | - os: macos-latest
19 | artifact_name: crabz
20 | asset_name: crabz-macos-amd64
21 | - os: windows-latest
22 | artifact_name: crabz.exe
23 | asset_name: crabz-windows-amd64.exe
24 |
25 | steps:
26 | - uses: actions/checkout@v2
27 |
28 | - name: Build
29 | shell: bash
30 | run: |
31 | cargo build --release --locked
32 |
33 | - name: Build archive
34 | shell: bash
35 | run: |
36 | staging="${{matrix.asset_name}}-src"
37 | mkdir -p "$staging"
38 |
39 | cp {README.md,UNLICENSE,LICENSE-MIT} "$staging/"
40 | cp {Cargo.toml,Cargo.lock} "$staging/"
41 | cp -R ./src "./$staging/src"
42 |
43 | if [ "${{ matrix.os }}" = "windows-latest" ]; then
44 | 7z a "${staging}.zip" "$staging"
45 | echo "ASSET=${staging}.zip" >> $GITHUB_ENV
46 | else
47 | tar czf "${staging}.tar.gz" "${staging}"
48 | echo "ASSET=${staging}.tar.gz" >> $GITHUB_ENV
49 | fi
50 |
51 | - name: Create deb artifact
52 | shell: bash
53 | run: |
54 | if [ "${{ matrix.os }}" = "ubuntu-latest" ]; then
55 | cd ..
56 | cargo install --locked cargo-deb
57 | cd -
58 | asset_path="${{ matrix.asset_name }}.deb"
59 | cargo deb --output ./"${asset_path}"
60 | echo "DEB=${asset_path}" >> $GITHUB_ENV
61 | fi
62 |
63 | - name: Upload deb package
64 | uses: svenstaro/upload-release-action@v2
65 | if: matrix.os == 'ubuntu-latest'
66 | with:
67 | repo_token: ${{ secrets.GITHUB_TOKEN }}
68 | file: ${{ env.DEB }}
69 | asset_name: ${{ env.DEB }}
70 | tag: ${{ github.ref }}
71 |
72 | - name: Upload src to release
73 | uses: svenstaro/upload-release-action@v2
74 | with:
75 | repo_token: ${{ secrets.GITHUB_TOKEN }}
76 | file: ${{ env.ASSET }}
77 | asset_name: ${{ env.ASSET }}
78 | tag: ${{ github.ref }}
79 |
80 | - name: Upload binaries to release
81 | uses: svenstaro/upload-release-action@v2
82 | with:
83 | repo_token: ${{ secrets.GITHUB_TOKEN }}
84 | file: target/release/${{ matrix.artifact_name }}
85 | asset_name: ${{ matrix.asset_name }}
86 | tag: ${{ github.ref }}
87 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | /target
2 | .idea
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # v0.10.0
2 |
3 | - [bugfix] Conditional compilation without snappy feature by @camlloyd
4 |
5 | # v0.9.4
6 |
7 | - [bugfix] Install `cargo-deb` outside of project directory
8 |
9 | # v0.9.3
10 |
11 | - [bugfix] Install `cargo-deb` outside of project directory
12 |
13 | # v0.9.2
14 |
15 | - [bugfix] Install `cargo-deb` with `--locked` in CI
16 |
17 | # v0.9.1
18 |
19 | - [bugfix](https://github.com/sstadick/crabz/pull/36) cargo update to fix dep resolution issue from @chenrui333
20 |
21 | # v0.9.0
22 |
23 | - [feat](https://github.com/sstadick/crabz/pull/34) Add `--quite` flag from @camlloyd
24 | - [feat](https://github.com/sstadick/crabz/pull/33) Update deflate file extensions from @camlloyd
25 |
26 | # v0.7.7
27 |
28 | - [bugfix](https://github.com/sstadick/crabz/pull/24) Remove benchmark data from distribution from @Shnatsel
29 | - [bugfix](https://github.com/sstadick/crabz/issues/25)
30 |
31 | # v0.7.6
32 |
33 | - Update deps, add dependabot
34 |
35 | # v0.7.5
36 |
37 | - Update deps, update thirdparty file, use fixed version of gzp
38 |
39 | # v0.7.4
40 |
41 | - Update deps, specifically gzp to take advantage of updated flate2
42 |
43 | # v0.7.3
44 |
45 | - [bugfix](https://github.com/sstadick/crabz/issues/14) Fixes feature flags to allow for compiling rust-only backend
46 |
47 | # v0.7.2
48 |
49 | - Includes updated THRIDPARYT.yml
50 |
51 | # v0.7.1
52 |
53 | - Fix [issue 11](https://github.com/sstadick/crabz/issues/11)
54 | - Adds "in-place" mode to decompress / compress by stripping/adding a suffix like other compression tools
55 | - Switch to mimalloc which showed large improvement with more threads
56 | - Add "pin-at" api to specifically pin the compression / decompression threads to cores starting at a specific core
57 | - Added benchmarks to README
58 |
--------------------------------------------------------------------------------
/Cargo.lock:
--------------------------------------------------------------------------------
1 | # This file is automatically @generated by Cargo.
2 | # It is not intended for manual editing.
3 | version = 3
4 |
5 | [[package]]
6 | name = "adler"
7 | version = "1.0.2"
8 | source = "registry+https://github.com/rust-lang/crates.io-index"
9 | checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe"
10 |
11 | [[package]]
12 | name = "aho-corasick"
13 | version = "1.1.2"
14 | source = "registry+https://github.com/rust-lang/crates.io-index"
15 | checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0"
16 | dependencies = [
17 | "memchr",
18 | ]
19 |
20 | [[package]]
21 | name = "ansi_term"
22 | version = "0.12.1"
23 | source = "registry+https://github.com/rust-lang/crates.io-index"
24 | checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2"
25 | dependencies = [
26 | "winapi",
27 | ]
28 |
29 | [[package]]
30 | name = "anyhow"
31 | version = "1.0.81"
32 | source = "registry+https://github.com/rust-lang/crates.io-index"
33 | checksum = "0952808a6c2afd1aa8947271f3a60f1a6763c7b912d210184c5149b5cf147247"
34 |
35 | [[package]]
36 | name = "atty"
37 | version = "0.2.14"
38 | source = "registry+https://github.com/rust-lang/crates.io-index"
39 | checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8"
40 | dependencies = [
41 | "hermit-abi 0.1.19",
42 | "libc",
43 | "winapi",
44 | ]
45 |
46 | [[package]]
47 | name = "autocfg"
48 | version = "1.1.0"
49 | source = "registry+https://github.com/rust-lang/crates.io-index"
50 | checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"
51 |
52 | [[package]]
53 | name = "bitflags"
54 | version = "1.3.2"
55 | source = "registry+https://github.com/rust-lang/crates.io-index"
56 | checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
57 |
58 | [[package]]
59 | name = "bumpalo"
60 | version = "3.15.4"
61 | source = "registry+https://github.com/rust-lang/crates.io-index"
62 | checksum = "7ff69b9dd49fd426c69a0db9fc04dd934cdb6645ff000864d98f7e2af8830eaa"
63 |
64 | [[package]]
65 | name = "byteorder"
66 | version = "1.5.0"
67 | source = "registry+https://github.com/rust-lang/crates.io-index"
68 | checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b"
69 |
70 | [[package]]
71 | name = "bytes"
72 | version = "1.5.0"
73 | source = "registry+https://github.com/rust-lang/crates.io-index"
74 | checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223"
75 |
76 | [[package]]
77 | name = "cc"
78 | version = "1.0.90"
79 | source = "registry+https://github.com/rust-lang/crates.io-index"
80 | checksum = "8cd6604a82acf3039f1144f54b8eb34e91ffba622051189e71b781822d5ee1f5"
81 |
82 | [[package]]
83 | name = "cfg-if"
84 | version = "1.0.0"
85 | source = "registry+https://github.com/rust-lang/crates.io-index"
86 | checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
87 |
88 | [[package]]
89 | name = "clap"
90 | version = "2.34.0"
91 | source = "registry+https://github.com/rust-lang/crates.io-index"
92 | checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c"
93 | dependencies = [
94 | "ansi_term",
95 | "atty",
96 | "bitflags",
97 | "strsim",
98 | "textwrap",
99 | "unicode-width",
100 | "vec_map",
101 | ]
102 |
103 | [[package]]
104 | name = "cmake"
105 | version = "0.1.50"
106 | source = "registry+https://github.com/rust-lang/crates.io-index"
107 | checksum = "a31c789563b815f77f4250caee12365734369f942439b7defd71e18a48197130"
108 | dependencies = [
109 | "cc",
110 | ]
111 |
112 | [[package]]
113 | name = "core_affinity"
114 | version = "0.8.1"
115 | source = "registry+https://github.com/rust-lang/crates.io-index"
116 | checksum = "622892f5635ce1fc38c8f16dfc938553ed64af482edb5e150bf4caedbfcb2304"
117 | dependencies = [
118 | "libc",
119 | "num_cpus",
120 | "winapi",
121 | ]
122 |
123 | [[package]]
124 | name = "crabz"
125 | version = "0.10.0"
126 | dependencies = [
127 | "anyhow",
128 | "env_logger",
129 | "flate2",
130 | "git-version",
131 | "gzp",
132 | "lazy_static",
133 | "log",
134 | "mimalloc",
135 | "num_cpus",
136 | "snap",
137 | "structopt",
138 | "strum",
139 | ]
140 |
141 | [[package]]
142 | name = "crc32fast"
143 | version = "1.4.0"
144 | source = "registry+https://github.com/rust-lang/crates.io-index"
145 | checksum = "b3855a8a784b474f333699ef2bbca9db2c4a1f6d9088a90a2d25b1eb53111eaa"
146 | dependencies = [
147 | "cfg-if",
148 | ]
149 |
150 | [[package]]
151 | name = "env_logger"
152 | version = "0.10.2"
153 | source = "registry+https://github.com/rust-lang/crates.io-index"
154 | checksum = "4cd405aab171cb85d6735e5c8d9db038c17d3ca007a4d2c25f337935c3d90580"
155 | dependencies = [
156 | "humantime",
157 | "is-terminal",
158 | "log",
159 | "regex",
160 | "termcolor",
161 | ]
162 |
163 | [[package]]
164 | name = "flate2"
165 | version = "1.0.28"
166 | source = "registry+https://github.com/rust-lang/crates.io-index"
167 | checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e"
168 | dependencies = [
169 | "crc32fast",
170 | "libz-sys",
171 | "miniz_oxide",
172 | ]
173 |
174 | [[package]]
175 | name = "flume"
176 | version = "0.10.14"
177 | source = "registry+https://github.com/rust-lang/crates.io-index"
178 | checksum = "1657b4441c3403d9f7b3409e47575237dac27b1b5726df654a6ecbf92f0f7577"
179 | dependencies = [
180 | "futures-core",
181 | "futures-sink",
182 | "nanorand",
183 | "pin-project",
184 | "spin",
185 | ]
186 |
187 | [[package]]
188 | name = "futures-core"
189 | version = "0.3.30"
190 | source = "registry+https://github.com/rust-lang/crates.io-index"
191 | checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d"
192 |
193 | [[package]]
194 | name = "futures-sink"
195 | version = "0.3.30"
196 | source = "registry+https://github.com/rust-lang/crates.io-index"
197 | checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5"
198 |
199 | [[package]]
200 | name = "getrandom"
201 | version = "0.2.12"
202 | source = "registry+https://github.com/rust-lang/crates.io-index"
203 | checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5"
204 | dependencies = [
205 | "cfg-if",
206 | "js-sys",
207 | "libc",
208 | "wasi",
209 | "wasm-bindgen",
210 | ]
211 |
212 | [[package]]
213 | name = "git-version"
214 | version = "0.3.9"
215 | source = "registry+https://github.com/rust-lang/crates.io-index"
216 | checksum = "1ad568aa3db0fcbc81f2f116137f263d7304f512a1209b35b85150d3ef88ad19"
217 | dependencies = [
218 | "git-version-macro",
219 | ]
220 |
221 | [[package]]
222 | name = "git-version-macro"
223 | version = "0.3.9"
224 | source = "registry+https://github.com/rust-lang/crates.io-index"
225 | checksum = "53010ccb100b96a67bc32c0175f0ed1426b31b655d562898e57325f81c023ac0"
226 | dependencies = [
227 | "proc-macro2",
228 | "quote",
229 | "syn 2.0.53",
230 | ]
231 |
232 | [[package]]
233 | name = "gzp"
234 | version = "0.11.3"
235 | source = "registry+https://github.com/rust-lang/crates.io-index"
236 | checksum = "e7c65d1899521a11810501b50b898464d133e1afc96703cff57726964cfa7baf"
237 | dependencies = [
238 | "byteorder",
239 | "bytes",
240 | "core_affinity",
241 | "flate2",
242 | "flume",
243 | "libdeflater",
244 | "libz-sys",
245 | "num_cpus",
246 | "snap",
247 | "thiserror",
248 | ]
249 |
250 | [[package]]
251 | name = "heck"
252 | version = "0.3.3"
253 | source = "registry+https://github.com/rust-lang/crates.io-index"
254 | checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c"
255 | dependencies = [
256 | "unicode-segmentation",
257 | ]
258 |
259 | [[package]]
260 | name = "heck"
261 | version = "0.4.1"
262 | source = "registry+https://github.com/rust-lang/crates.io-index"
263 | checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8"
264 |
265 | [[package]]
266 | name = "hermit-abi"
267 | version = "0.1.19"
268 | source = "registry+https://github.com/rust-lang/crates.io-index"
269 | checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33"
270 | dependencies = [
271 | "libc",
272 | ]
273 |
274 | [[package]]
275 | name = "hermit-abi"
276 | version = "0.3.9"
277 | source = "registry+https://github.com/rust-lang/crates.io-index"
278 | checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024"
279 |
280 | [[package]]
281 | name = "humantime"
282 | version = "2.1.0"
283 | source = "registry+https://github.com/rust-lang/crates.io-index"
284 | checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4"
285 |
286 | [[package]]
287 | name = "is-terminal"
288 | version = "0.4.12"
289 | source = "registry+https://github.com/rust-lang/crates.io-index"
290 | checksum = "f23ff5ef2b80d608d61efee834934d862cd92461afc0560dedf493e4c033738b"
291 | dependencies = [
292 | "hermit-abi 0.3.9",
293 | "libc",
294 | "windows-sys",
295 | ]
296 |
297 | [[package]]
298 | name = "js-sys"
299 | version = "0.3.69"
300 | source = "registry+https://github.com/rust-lang/crates.io-index"
301 | checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d"
302 | dependencies = [
303 | "wasm-bindgen",
304 | ]
305 |
306 | [[package]]
307 | name = "lazy_static"
308 | version = "1.4.0"
309 | source = "registry+https://github.com/rust-lang/crates.io-index"
310 | checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
311 |
312 | [[package]]
313 | name = "libc"
314 | version = "0.2.153"
315 | source = "registry+https://github.com/rust-lang/crates.io-index"
316 | checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd"
317 |
318 | [[package]]
319 | name = "libdeflate-sys"
320 | version = "0.12.0"
321 | source = "registry+https://github.com/rust-lang/crates.io-index"
322 | checksum = "e1f7b0817f85e2ba608892f30fbf4c9d03f3ebf9db0c952d1b7c8f7387b54785"
323 | dependencies = [
324 | "cc",
325 | ]
326 |
327 | [[package]]
328 | name = "libdeflater"
329 | version = "0.12.0"
330 | source = "registry+https://github.com/rust-lang/crates.io-index"
331 | checksum = "671e63282f642c7bcc7d292b212d5a4739fef02a77fe98429a75d308f96e7931"
332 | dependencies = [
333 | "libdeflate-sys",
334 | ]
335 |
336 | [[package]]
337 | name = "libmimalloc-sys"
338 | version = "0.1.35"
339 | source = "registry+https://github.com/rust-lang/crates.io-index"
340 | checksum = "3979b5c37ece694f1f5e51e7ecc871fdb0f517ed04ee45f88d15d6d553cb9664"
341 | dependencies = [
342 | "cc",
343 | "libc",
344 | ]
345 |
346 | [[package]]
347 | name = "libz-sys"
348 | version = "1.1.15"
349 | source = "registry+https://github.com/rust-lang/crates.io-index"
350 | checksum = "037731f5d3aaa87a5675e895b63ddff1a87624bc29f77004ea829809654e48f6"
351 | dependencies = [
352 | "cc",
353 | "cmake",
354 | "libc",
355 | "pkg-config",
356 | "vcpkg",
357 | ]
358 |
359 | [[package]]
360 | name = "lock_api"
361 | version = "0.4.11"
362 | source = "registry+https://github.com/rust-lang/crates.io-index"
363 | checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45"
364 | dependencies = [
365 | "autocfg",
366 | "scopeguard",
367 | ]
368 |
369 | [[package]]
370 | name = "log"
371 | version = "0.4.21"
372 | source = "registry+https://github.com/rust-lang/crates.io-index"
373 | checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c"
374 |
375 | [[package]]
376 | name = "memchr"
377 | version = "2.7.1"
378 | source = "registry+https://github.com/rust-lang/crates.io-index"
379 | checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149"
380 |
381 | [[package]]
382 | name = "mimalloc"
383 | version = "0.1.39"
384 | source = "registry+https://github.com/rust-lang/crates.io-index"
385 | checksum = "fa01922b5ea280a911e323e4d2fd24b7fe5cc4042e0d2cda3c40775cdc4bdc9c"
386 | dependencies = [
387 | "libmimalloc-sys",
388 | ]
389 |
390 | [[package]]
391 | name = "miniz_oxide"
392 | version = "0.7.2"
393 | source = "registry+https://github.com/rust-lang/crates.io-index"
394 | checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7"
395 | dependencies = [
396 | "adler",
397 | ]
398 |
399 | [[package]]
400 | name = "nanorand"
401 | version = "0.7.0"
402 | source = "registry+https://github.com/rust-lang/crates.io-index"
403 | checksum = "6a51313c5820b0b02bd422f4b44776fbf47961755c74ce64afc73bfad10226c3"
404 | dependencies = [
405 | "getrandom",
406 | ]
407 |
408 | [[package]]
409 | name = "num_cpus"
410 | version = "1.16.0"
411 | source = "registry+https://github.com/rust-lang/crates.io-index"
412 | checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43"
413 | dependencies = [
414 | "hermit-abi 0.3.9",
415 | "libc",
416 | ]
417 |
418 | [[package]]
419 | name = "once_cell"
420 | version = "1.19.0"
421 | source = "registry+https://github.com/rust-lang/crates.io-index"
422 | checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92"
423 |
424 | [[package]]
425 | name = "pin-project"
426 | version = "1.1.5"
427 | source = "registry+https://github.com/rust-lang/crates.io-index"
428 | checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3"
429 | dependencies = [
430 | "pin-project-internal",
431 | ]
432 |
433 | [[package]]
434 | name = "pin-project-internal"
435 | version = "1.1.5"
436 | source = "registry+https://github.com/rust-lang/crates.io-index"
437 | checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965"
438 | dependencies = [
439 | "proc-macro2",
440 | "quote",
441 | "syn 2.0.53",
442 | ]
443 |
444 | [[package]]
445 | name = "pkg-config"
446 | version = "0.3.30"
447 | source = "registry+https://github.com/rust-lang/crates.io-index"
448 | checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec"
449 |
450 | [[package]]
451 | name = "proc-macro-error"
452 | version = "1.0.4"
453 | source = "registry+https://github.com/rust-lang/crates.io-index"
454 | checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c"
455 | dependencies = [
456 | "proc-macro-error-attr",
457 | "proc-macro2",
458 | "quote",
459 | "syn 1.0.109",
460 | "version_check",
461 | ]
462 |
463 | [[package]]
464 | name = "proc-macro-error-attr"
465 | version = "1.0.4"
466 | source = "registry+https://github.com/rust-lang/crates.io-index"
467 | checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869"
468 | dependencies = [
469 | "proc-macro2",
470 | "quote",
471 | "version_check",
472 | ]
473 |
474 | [[package]]
475 | name = "proc-macro2"
476 | version = "1.0.79"
477 | source = "registry+https://github.com/rust-lang/crates.io-index"
478 | checksum = "e835ff2298f5721608eb1a980ecaee1aef2c132bf95ecc026a11b7bf3c01c02e"
479 | dependencies = [
480 | "unicode-ident",
481 | ]
482 |
483 | [[package]]
484 | name = "quote"
485 | version = "1.0.35"
486 | source = "registry+https://github.com/rust-lang/crates.io-index"
487 | checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef"
488 | dependencies = [
489 | "proc-macro2",
490 | ]
491 |
492 | [[package]]
493 | name = "regex"
494 | version = "1.10.3"
495 | source = "registry+https://github.com/rust-lang/crates.io-index"
496 | checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15"
497 | dependencies = [
498 | "aho-corasick",
499 | "memchr",
500 | "regex-automata",
501 | "regex-syntax",
502 | ]
503 |
504 | [[package]]
505 | name = "regex-automata"
506 | version = "0.4.6"
507 | source = "registry+https://github.com/rust-lang/crates.io-index"
508 | checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea"
509 | dependencies = [
510 | "aho-corasick",
511 | "memchr",
512 | "regex-syntax",
513 | ]
514 |
515 | [[package]]
516 | name = "regex-syntax"
517 | version = "0.8.2"
518 | source = "registry+https://github.com/rust-lang/crates.io-index"
519 | checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f"
520 |
521 | [[package]]
522 | name = "rustversion"
523 | version = "1.0.14"
524 | source = "registry+https://github.com/rust-lang/crates.io-index"
525 | checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4"
526 |
527 | [[package]]
528 | name = "scopeguard"
529 | version = "1.2.0"
530 | source = "registry+https://github.com/rust-lang/crates.io-index"
531 | checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
532 |
533 | [[package]]
534 | name = "snap"
535 | version = "1.1.1"
536 | source = "registry+https://github.com/rust-lang/crates.io-index"
537 | checksum = "1b6b67fb9a61334225b5b790716f609cd58395f895b3fe8b328786812a40bc3b"
538 |
539 | [[package]]
540 | name = "spin"
541 | version = "0.9.8"
542 | source = "registry+https://github.com/rust-lang/crates.io-index"
543 | checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67"
544 | dependencies = [
545 | "lock_api",
546 | ]
547 |
548 | [[package]]
549 | name = "strsim"
550 | version = "0.8.0"
551 | source = "registry+https://github.com/rust-lang/crates.io-index"
552 | checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a"
553 |
554 | [[package]]
555 | name = "structopt"
556 | version = "0.3.26"
557 | source = "registry+https://github.com/rust-lang/crates.io-index"
558 | checksum = "0c6b5c64445ba8094a6ab0c3cd2ad323e07171012d9c98b0b15651daf1787a10"
559 | dependencies = [
560 | "clap",
561 | "lazy_static",
562 | "structopt-derive",
563 | ]
564 |
565 | [[package]]
566 | name = "structopt-derive"
567 | version = "0.4.18"
568 | source = "registry+https://github.com/rust-lang/crates.io-index"
569 | checksum = "dcb5ae327f9cc13b68763b5749770cb9e048a99bd9dfdfa58d0cf05d5f64afe0"
570 | dependencies = [
571 | "heck 0.3.3",
572 | "proc-macro-error",
573 | "proc-macro2",
574 | "quote",
575 | "syn 1.0.109",
576 | ]
577 |
578 | [[package]]
579 | name = "strum"
580 | version = "0.24.1"
581 | source = "registry+https://github.com/rust-lang/crates.io-index"
582 | checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f"
583 | dependencies = [
584 | "strum_macros",
585 | ]
586 |
587 | [[package]]
588 | name = "strum_macros"
589 | version = "0.24.3"
590 | source = "registry+https://github.com/rust-lang/crates.io-index"
591 | checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59"
592 | dependencies = [
593 | "heck 0.4.1",
594 | "proc-macro2",
595 | "quote",
596 | "rustversion",
597 | "syn 1.0.109",
598 | ]
599 |
600 | [[package]]
601 | name = "syn"
602 | version = "1.0.109"
603 | source = "registry+https://github.com/rust-lang/crates.io-index"
604 | checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237"
605 | dependencies = [
606 | "proc-macro2",
607 | "quote",
608 | "unicode-ident",
609 | ]
610 |
611 | [[package]]
612 | name = "syn"
613 | version = "2.0.53"
614 | source = "registry+https://github.com/rust-lang/crates.io-index"
615 | checksum = "7383cd0e49fff4b6b90ca5670bfd3e9d6a733b3f90c686605aa7eec8c4996032"
616 | dependencies = [
617 | "proc-macro2",
618 | "quote",
619 | "unicode-ident",
620 | ]
621 |
622 | [[package]]
623 | name = "termcolor"
624 | version = "1.4.1"
625 | source = "registry+https://github.com/rust-lang/crates.io-index"
626 | checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755"
627 | dependencies = [
628 | "winapi-util",
629 | ]
630 |
631 | [[package]]
632 | name = "textwrap"
633 | version = "0.11.0"
634 | source = "registry+https://github.com/rust-lang/crates.io-index"
635 | checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060"
636 | dependencies = [
637 | "unicode-width",
638 | ]
639 |
640 | [[package]]
641 | name = "thiserror"
642 | version = "1.0.58"
643 | source = "registry+https://github.com/rust-lang/crates.io-index"
644 | checksum = "03468839009160513471e86a034bb2c5c0e4baae3b43f79ffc55c4a5427b3297"
645 | dependencies = [
646 | "thiserror-impl",
647 | ]
648 |
649 | [[package]]
650 | name = "thiserror-impl"
651 | version = "1.0.58"
652 | source = "registry+https://github.com/rust-lang/crates.io-index"
653 | checksum = "c61f3ba182994efc43764a46c018c347bc492c79f024e705f46567b418f6d4f7"
654 | dependencies = [
655 | "proc-macro2",
656 | "quote",
657 | "syn 2.0.53",
658 | ]
659 |
660 | [[package]]
661 | name = "unicode-ident"
662 | version = "1.0.12"
663 | source = "registry+https://github.com/rust-lang/crates.io-index"
664 | checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b"
665 |
666 | [[package]]
667 | name = "unicode-segmentation"
668 | version = "1.11.0"
669 | source = "registry+https://github.com/rust-lang/crates.io-index"
670 | checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202"
671 |
672 | [[package]]
673 | name = "unicode-width"
674 | version = "0.1.11"
675 | source = "registry+https://github.com/rust-lang/crates.io-index"
676 | checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85"
677 |
678 | [[package]]
679 | name = "vcpkg"
680 | version = "0.2.15"
681 | source = "registry+https://github.com/rust-lang/crates.io-index"
682 | checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426"
683 |
684 | [[package]]
685 | name = "vec_map"
686 | version = "0.8.2"
687 | source = "registry+https://github.com/rust-lang/crates.io-index"
688 | checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191"
689 |
690 | [[package]]
691 | name = "version_check"
692 | version = "0.9.4"
693 | source = "registry+https://github.com/rust-lang/crates.io-index"
694 | checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"
695 |
696 | [[package]]
697 | name = "wasi"
698 | version = "0.11.0+wasi-snapshot-preview1"
699 | source = "registry+https://github.com/rust-lang/crates.io-index"
700 | checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
701 |
702 | [[package]]
703 | name = "wasm-bindgen"
704 | version = "0.2.92"
705 | source = "registry+https://github.com/rust-lang/crates.io-index"
706 | checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8"
707 | dependencies = [
708 | "cfg-if",
709 | "wasm-bindgen-macro",
710 | ]
711 |
712 | [[package]]
713 | name = "wasm-bindgen-backend"
714 | version = "0.2.92"
715 | source = "registry+https://github.com/rust-lang/crates.io-index"
716 | checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da"
717 | dependencies = [
718 | "bumpalo",
719 | "log",
720 | "once_cell",
721 | "proc-macro2",
722 | "quote",
723 | "syn 2.0.53",
724 | "wasm-bindgen-shared",
725 | ]
726 |
727 | [[package]]
728 | name = "wasm-bindgen-macro"
729 | version = "0.2.92"
730 | source = "registry+https://github.com/rust-lang/crates.io-index"
731 | checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726"
732 | dependencies = [
733 | "quote",
734 | "wasm-bindgen-macro-support",
735 | ]
736 |
737 | [[package]]
738 | name = "wasm-bindgen-macro-support"
739 | version = "0.2.92"
740 | source = "registry+https://github.com/rust-lang/crates.io-index"
741 | checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7"
742 | dependencies = [
743 | "proc-macro2",
744 | "quote",
745 | "syn 2.0.53",
746 | "wasm-bindgen-backend",
747 | "wasm-bindgen-shared",
748 | ]
749 |
750 | [[package]]
751 | name = "wasm-bindgen-shared"
752 | version = "0.2.92"
753 | source = "registry+https://github.com/rust-lang/crates.io-index"
754 | checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96"
755 |
756 | [[package]]
757 | name = "winapi"
758 | version = "0.3.9"
759 | source = "registry+https://github.com/rust-lang/crates.io-index"
760 | checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
761 | dependencies = [
762 | "winapi-i686-pc-windows-gnu",
763 | "winapi-x86_64-pc-windows-gnu",
764 | ]
765 |
766 | [[package]]
767 | name = "winapi-i686-pc-windows-gnu"
768 | version = "0.4.0"
769 | source = "registry+https://github.com/rust-lang/crates.io-index"
770 | checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
771 |
772 | [[package]]
773 | name = "winapi-util"
774 | version = "0.1.6"
775 | source = "registry+https://github.com/rust-lang/crates.io-index"
776 | checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596"
777 | dependencies = [
778 | "winapi",
779 | ]
780 |
781 | [[package]]
782 | name = "winapi-x86_64-pc-windows-gnu"
783 | version = "0.4.0"
784 | source = "registry+https://github.com/rust-lang/crates.io-index"
785 | checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
786 |
787 | [[package]]
788 | name = "windows-sys"
789 | version = "0.52.0"
790 | source = "registry+https://github.com/rust-lang/crates.io-index"
791 | checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d"
792 | dependencies = [
793 | "windows-targets",
794 | ]
795 |
796 | [[package]]
797 | name = "windows-targets"
798 | version = "0.52.4"
799 | source = "registry+https://github.com/rust-lang/crates.io-index"
800 | checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b"
801 | dependencies = [
802 | "windows_aarch64_gnullvm",
803 | "windows_aarch64_msvc",
804 | "windows_i686_gnu",
805 | "windows_i686_msvc",
806 | "windows_x86_64_gnu",
807 | "windows_x86_64_gnullvm",
808 | "windows_x86_64_msvc",
809 | ]
810 |
811 | [[package]]
812 | name = "windows_aarch64_gnullvm"
813 | version = "0.52.4"
814 | source = "registry+https://github.com/rust-lang/crates.io-index"
815 | checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9"
816 |
817 | [[package]]
818 | name = "windows_aarch64_msvc"
819 | version = "0.52.4"
820 | source = "registry+https://github.com/rust-lang/crates.io-index"
821 | checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675"
822 |
823 | [[package]]
824 | name = "windows_i686_gnu"
825 | version = "0.52.4"
826 | source = "registry+https://github.com/rust-lang/crates.io-index"
827 | checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3"
828 |
829 | [[package]]
830 | name = "windows_i686_msvc"
831 | version = "0.52.4"
832 | source = "registry+https://github.com/rust-lang/crates.io-index"
833 | checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02"
834 |
835 | [[package]]
836 | name = "windows_x86_64_gnu"
837 | version = "0.52.4"
838 | source = "registry+https://github.com/rust-lang/crates.io-index"
839 | checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03"
840 |
841 | [[package]]
842 | name = "windows_x86_64_gnullvm"
843 | version = "0.52.4"
844 | source = "registry+https://github.com/rust-lang/crates.io-index"
845 | checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177"
846 |
847 | [[package]]
848 | name = "windows_x86_64_msvc"
849 | version = "0.52.4"
850 | source = "registry+https://github.com/rust-lang/crates.io-index"
851 | checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8"
852 |
--------------------------------------------------------------------------------
/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "crabz"
3 | authors = ["Seth Stadick"]
4 | version = "0.10.0"
5 | edition = "2018"
6 | license = "Unlicense/MIT"
7 | readme = "README.md"
8 | documentation = "https://docs.rs/crabz"
9 | homepage = "https://github.com/sstadick/crabz"
10 | repository = "https://github.com/sstadick/crabz"
11 | categories = ["compression", "concurrency"]
12 | keywords = ["compression", "parallel", "pigz"]
13 | description = "Parallel Compression"
14 | exclude = ["bench-data/"]
15 |
16 | [[bin]]
17 | name = "crabz"
18 | path = "src/main.rs"
19 |
20 | [features]
21 | default = ["deflate_zlib_ng", "snap_default", "libdeflate"]
22 |
23 | deflate_zlib_ng = ["gzp/deflate_zlib_ng", "flate2/zlib-ng-compat", "any_zlib"]
24 | deflate_zlib = ["gzp/deflate_zlib", "flate2/zlib", "any_zlib"]
25 | deflate_rust = ["gzp/deflate_rust", "flate2/rust_backend"]
26 | snap_default = ["gzp/snappy_default", "snap", "snappy"]
27 | libdeflate = ["gzp/libdeflate"]
28 |
29 | snappy = [] # internal feature flag
30 | any_zlib = [] # internal feature flag
31 |
32 |
33 | [dependencies]
34 | anyhow = "1.0.68"
35 | env_logger = { version = "0.10.0", default-features = false, features = ["default"] }
36 | flate2 = { version = "1.0.25", default-features = false }
37 | gzp = { version = "0.11.3", default-features = false }
38 | lazy_static = "1.4.0"
39 | log = "0.4.17"
40 | num_cpus = "1.15.0"
41 | structopt = "0.3.26"
42 | strum = { version = "0.24.1", features = ["derive"] }
43 | snap = { version = "1.1.0", optional = true }
44 | mimalloc = { version = "0.1.34", default-features = false }
45 | git-version = "0.3.5"
46 |
--------------------------------------------------------------------------------
/LICENSE-MIT:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2021 Seth Stadick
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in
13 | all copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | THE SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # 🦀 crabz
2 |
3 |
4 |
5 |
6 |
7 | 
8 | Like pigz, but rust.
9 |
10 |
11 | A cross platform, fast, compression and decompression tool.
12 |
13 | ## Synopsis
14 |
15 | This is currently a proof of concept CLI tool using the [`gzp`](https://github.com/sstadick/gzp/) crate.
16 |
17 | Supported formats:
18 |
19 | - Gzip
20 | - Zlib
21 | - Mgzip
22 | - BGZF
23 | - Raw Deflate
24 | - Snap
25 |
26 | ## Install
27 |
28 | * Homebrew / Linuxbrew
29 |
30 | ```
31 | brew tap sstadick/crabz
32 | brew install crabz
33 | ```
34 |
35 | * Debian (Ubuntu)
36 |
37 | ```
38 | curl -LO https://github.com/sstadick/crabz/releases/download//crabz-linux-amd64.deb
39 | sudo dpkg -i crabz-linux-amd64.deb
40 | ```
41 |
42 | * Cargo
43 |
44 | ```
45 | cargo install crabz
46 | ```
47 |
48 | * Conda
49 |
50 | ```
51 | conda install -c conda-forge crabz
52 | ```
53 |
54 |
55 | ## Usage
56 |
57 | ```
58 | ❯ crabz -h
59 | Compress and decompress files
60 |
61 | USAGE:
62 | crabz [FLAGS] [OPTIONS] [FILE]
63 |
64 | FLAGS:
65 | -d, --decompress
66 | Flag to switch to decompressing inputs. Note: this flag may change in future releases
67 |
68 | -h, --help
69 | Prints help information
70 |
71 | -I, --in-place
72 | Perform the compression / decompression in place.
73 |
74 | **NOTE** this will remove the input file at completion.
75 | -V, --version
76 | Prints version information
77 |
78 |
79 | OPTIONS:
80 | -l, --compression-level
81 | Compression level [default: 6]
82 |
83 | -p, --compression-threads
84 | Number of compression threads to use, or if decompressing a format that allow for multi-threaded
85 | decompression, the number to use. Note that > 4 threads for decompression doesn't seem to help [default:
86 | 32]
87 | -f, --format
88 | The format to use [default: gzip] [possible values: gzip, bgzf, mgzip,
89 | zlib, deflate, snap]
90 | -o, --output