multi_compress 0.3.2 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +10 -3
- data/GET_STARTED.md +3 -3
- data/README.md +75 -66
- data/THIRD_PARTY_NOTICES.md +24 -0
- data/ext/multi_compress/brotli_dec_static_init.c +3 -0
- data/ext/multi_compress/brotli_enc_static_init.c +3 -0
- data/ext/multi_compress/extconf.rb +22 -1
- data/ext/multi_compress/vendor/.vendored +2 -2
- data/ext/multi_compress/vendor/brotli/LICENSE +19 -0
- data/ext/multi_compress/vendor/brotli/c/common/constants.c +7 -7
- data/ext/multi_compress/vendor/brotli/c/common/constants.h +2 -5
- data/ext/multi_compress/vendor/brotli/c/common/context.c +2 -2
- data/ext/multi_compress/vendor/brotli/c/common/context.h +1 -2
- data/ext/multi_compress/vendor/brotli/c/common/dictionary.c +4 -5856
- data/ext/multi_compress/vendor/brotli/c/common/dictionary.h +1 -2
- data/ext/multi_compress/vendor/brotli/c/common/dictionary_inc.h +5847 -0
- data/ext/multi_compress/vendor/brotli/c/common/platform.c +0 -4
- data/ext/multi_compress/vendor/brotli/c/common/platform.h +182 -43
- data/ext/multi_compress/vendor/brotli/c/common/shared_dictionary.c +3 -7
- data/ext/multi_compress/vendor/brotli/c/common/shared_dictionary_internal.h +1 -1
- data/ext/multi_compress/vendor/brotli/c/common/static_init.h +56 -0
- data/ext/multi_compress/vendor/brotli/c/common/transform.c +6 -4
- data/ext/multi_compress/vendor/brotli/c/common/transform.h +1 -2
- data/ext/multi_compress/vendor/brotli/c/common/version.h +3 -3
- data/ext/multi_compress/vendor/brotli/c/dec/bit_reader.c +2 -3
- data/ext/multi_compress/vendor/brotli/c/dec/bit_reader.h +0 -4
- data/ext/multi_compress/vendor/brotli/c/dec/decode.c +128 -39
- data/ext/multi_compress/vendor/brotli/c/dec/huffman.c +2 -5
- data/ext/multi_compress/vendor/brotli/c/dec/huffman.h +0 -2
- data/ext/multi_compress/vendor/brotli/c/dec/prefix.c +67 -0
- data/ext/multi_compress/vendor/brotli/c/dec/prefix.h +18 -708
- data/ext/multi_compress/vendor/brotli/c/dec/prefix_inc.h +707 -0
- data/ext/multi_compress/vendor/brotli/c/dec/state.c +18 -15
- data/ext/multi_compress/vendor/brotli/c/dec/state.h +2 -6
- data/ext/multi_compress/vendor/brotli/c/dec/static_init.c +53 -0
- data/ext/multi_compress/vendor/brotli/c/dec/static_init.h +30 -0
- data/ext/multi_compress/vendor/brotli/c/enc/backward_references.c +32 -8
- data/ext/multi_compress/vendor/brotli/c/enc/backward_references.h +1 -5
- data/ext/multi_compress/vendor/brotli/c/enc/backward_references_hq.c +15 -15
- data/ext/multi_compress/vendor/brotli/c/enc/backward_references_hq.h +1 -5
- data/ext/multi_compress/vendor/brotli/c/enc/bit_cost.c +28 -4
- data/ext/multi_compress/vendor/brotli/c/enc/bit_cost.h +8 -40
- data/ext/multi_compress/vendor/brotli/c/enc/bit_cost_inc.h +1 -1
- data/ext/multi_compress/vendor/brotli/c/enc/block_splitter.c +9 -12
- data/ext/multi_compress/vendor/brotli/c/enc/block_splitter.h +0 -3
- data/ext/multi_compress/vendor/brotli/c/enc/block_splitter_inc.h +14 -8
- data/ext/multi_compress/vendor/brotli/c/enc/brotli_bit_stream.c +10 -9
- data/ext/multi_compress/vendor/brotli/c/enc/brotli_bit_stream.h +0 -6
- data/ext/multi_compress/vendor/brotli/c/enc/cluster.c +0 -2
- data/ext/multi_compress/vendor/brotli/c/enc/cluster.h +0 -2
- data/ext/multi_compress/vendor/brotli/c/enc/command.c +1 -1
- data/ext/multi_compress/vendor/brotli/c/enc/command.h +8 -10
- data/ext/multi_compress/vendor/brotli/c/enc/compound_dictionary.c +3 -5
- data/ext/multi_compress/vendor/brotli/c/enc/compound_dictionary.h +1 -4
- data/ext/multi_compress/vendor/brotli/c/enc/compress_fragment.c +3 -13
- data/ext/multi_compress/vendor/brotli/c/enc/compress_fragment.h +0 -2
- data/ext/multi_compress/vendor/brotli/c/enc/compress_fragment_two_pass.c +5 -15
- data/ext/multi_compress/vendor/brotli/c/enc/compress_fragment_two_pass.h +0 -2
- data/ext/multi_compress/vendor/brotli/c/enc/dictionary_hash.c +127 -1830
- data/ext/multi_compress/vendor/brotli/c/enc/dictionary_hash.h +23 -3
- data/ext/multi_compress/vendor/brotli/c/enc/dictionary_hash_inc.h +1829 -0
- data/ext/multi_compress/vendor/brotli/c/enc/encode.c +77 -52
- data/ext/multi_compress/vendor/brotli/c/enc/encoder_dict.c +9 -7
- data/ext/multi_compress/vendor/brotli/c/enc/encoder_dict.h +2 -4
- data/ext/multi_compress/vendor/brotli/c/enc/entropy_encode.c +3 -6
- data/ext/multi_compress/vendor/brotli/c/enc/entropy_encode.h +2 -4
- data/ext/multi_compress/vendor/brotli/c/enc/entropy_encode_static.h +18 -12
- data/ext/multi_compress/vendor/brotli/c/enc/fast_log.c +1 -1
- data/ext/multi_compress/vendor/brotli/c/enc/fast_log.h +2 -3
- data/ext/multi_compress/vendor/brotli/c/enc/find_match_length.h +0 -2
- data/ext/multi_compress/vendor/brotli/c/enc/hash.h +38 -31
- data/ext/multi_compress/vendor/brotli/c/enc/hash_base.h +38 -0
- data/ext/multi_compress/vendor/brotli/c/enc/hash_forgetful_chain_inc.h +11 -1
- data/ext/multi_compress/vendor/brotli/c/enc/hash_longest_match64_inc.h +24 -7
- data/ext/multi_compress/vendor/brotli/c/enc/hash_longest_match64_simd_inc.h +304 -0
- data/ext/multi_compress/vendor/brotli/c/enc/hash_longest_match_inc.h +30 -11
- data/ext/multi_compress/vendor/brotli/c/enc/hash_longest_match_quickly_inc.h +4 -0
- data/ext/multi_compress/vendor/brotli/c/enc/hash_longest_match_simd_inc.h +278 -0
- data/ext/multi_compress/vendor/brotli/c/enc/histogram.c +1 -0
- data/ext/multi_compress/vendor/brotli/c/enc/histogram.h +0 -4
- data/ext/multi_compress/vendor/brotli/c/enc/literal_cost.c +4 -6
- data/ext/multi_compress/vendor/brotli/c/enc/literal_cost.h +0 -2
- data/ext/multi_compress/vendor/brotli/c/enc/matching_tag_mask.h +69 -0
- data/ext/multi_compress/vendor/brotli/c/enc/memory.c +0 -5
- data/ext/multi_compress/vendor/brotli/c/enc/memory.h +0 -4
- data/ext/multi_compress/vendor/brotli/c/enc/metablock.c +7 -9
- data/ext/multi_compress/vendor/brotli/c/enc/metablock.h +3 -3
- data/ext/multi_compress/vendor/brotli/c/enc/metablock_inc.h +4 -4
- data/ext/multi_compress/vendor/brotli/c/enc/params.h +0 -1
- data/ext/multi_compress/vendor/brotli/c/enc/prefix.h +0 -2
- data/ext/multi_compress/vendor/brotli/c/enc/quality.h +17 -10
- data/ext/multi_compress/vendor/brotli/c/enc/ringbuffer.h +1 -4
- data/ext/multi_compress/vendor/brotli/c/enc/state.h +2 -2
- data/ext/multi_compress/vendor/brotli/c/enc/static_dict.c +5 -11
- data/ext/multi_compress/vendor/brotli/c/enc/static_dict.h +1 -3
- data/ext/multi_compress/vendor/brotli/c/enc/static_dict_lut.c +224 -0
- data/ext/multi_compress/vendor/brotli/c/enc/static_dict_lut.h +20 -5837
- data/ext/multi_compress/vendor/brotli/c/enc/static_dict_lut_inc.h +5830 -0
- data/ext/multi_compress/vendor/brotli/c/enc/static_init.c +59 -0
- data/ext/multi_compress/vendor/brotli/c/enc/static_init.h +30 -0
- data/ext/multi_compress/vendor/brotli/c/enc/static_init_lazy.cc +26 -0
- data/ext/multi_compress/vendor/brotli/c/enc/utf8_util.c +1 -1
- data/ext/multi_compress/vendor/brotli/c/enc/utf8_util.h +0 -2
- data/ext/multi_compress/vendor/brotli/c/enc/write_bits.h +0 -2
- data/ext/multi_compress/vendor/brotli/c/include/brotli/decode.h +1 -1
- data/ext/multi_compress/vendor/brotli/c/include/brotli/encode.h +5 -1
- data/ext/multi_compress/vendor/brotli/c/include/brotli/port.h +4 -7
- data/ext/multi_compress/vendor/brotli/c/include/brotli/types.h +2 -2
- data/ext/multi_compress/vendor/lz4/LICENSE +12 -0
- data/ext/multi_compress/vendor/zstd/COPYING +339 -0
- data/ext/multi_compress/vendor/zstd/LICENSE +30 -0
- data/ext/multi_compress/vendor/zstd/lib/Makefile +67 -35
- data/ext/multi_compress/vendor/zstd/lib/README.md +33 -2
- data/ext/multi_compress/vendor/zstd/lib/common/allocations.h +55 -0
- data/ext/multi_compress/vendor/zstd/lib/common/bits.h +205 -0
- data/ext/multi_compress/vendor/zstd/lib/common/bitstream.h +84 -108
- data/ext/multi_compress/vendor/zstd/lib/common/compiler.h +170 -41
- data/ext/multi_compress/vendor/zstd/lib/common/cpu.h +37 -1
- data/ext/multi_compress/vendor/zstd/lib/common/debug.c +7 -1
- data/ext/multi_compress/vendor/zstd/lib/common/debug.h +21 -21
- data/ext/multi_compress/vendor/zstd/lib/common/entropy_common.c +12 -40
- data/ext/multi_compress/vendor/zstd/lib/common/error_private.c +10 -2
- data/ext/multi_compress/vendor/zstd/lib/common/error_private.h +46 -47
- data/ext/multi_compress/vendor/zstd/lib/common/fse.h +8 -100
- data/ext/multi_compress/vendor/zstd/lib/common/fse_decompress.c +28 -116
- data/ext/multi_compress/vendor/zstd/lib/common/huf.h +79 -166
- data/ext/multi_compress/vendor/zstd/lib/common/mem.h +46 -66
- data/ext/multi_compress/vendor/zstd/lib/common/pool.c +27 -11
- data/ext/multi_compress/vendor/zstd/lib/common/pool.h +8 -11
- data/ext/multi_compress/vendor/zstd/lib/common/portability_macros.h +45 -11
- data/ext/multi_compress/vendor/zstd/lib/common/threading.c +74 -14
- data/ext/multi_compress/vendor/zstd/lib/common/threading.h +5 -18
- data/ext/multi_compress/vendor/zstd/lib/common/xxhash.c +5 -11
- data/ext/multi_compress/vendor/zstd/lib/common/xxhash.h +2411 -1003
- data/ext/multi_compress/vendor/zstd/lib/common/zstd_common.c +1 -36
- data/ext/multi_compress/vendor/zstd/lib/common/zstd_deps.h +13 -1
- data/ext/multi_compress/vendor/zstd/lib/common/zstd_internal.h +13 -182
- data/ext/multi_compress/vendor/zstd/lib/common/zstd_trace.h +6 -13
- data/ext/multi_compress/vendor/zstd/lib/compress/clevels.h +1 -1
- data/ext/multi_compress/vendor/zstd/lib/compress/fse_compress.c +15 -131
- data/ext/multi_compress/vendor/zstd/lib/compress/hist.c +11 -1
- data/ext/multi_compress/vendor/zstd/lib/compress/hist.h +8 -1
- data/ext/multi_compress/vendor/zstd/lib/compress/huf_compress.c +283 -189
- data/ext/multi_compress/vendor/zstd/lib/compress/zstd_compress.c +2419 -903
- data/ext/multi_compress/vendor/zstd/lib/compress/zstd_compress_internal.h +423 -245
- data/ext/multi_compress/vendor/zstd/lib/compress/zstd_compress_literals.c +116 -40
- data/ext/multi_compress/vendor/zstd/lib/compress/zstd_compress_literals.h +16 -8
- data/ext/multi_compress/vendor/zstd/lib/compress/zstd_compress_sequences.c +10 -10
- data/ext/multi_compress/vendor/zstd/lib/compress/zstd_compress_sequences.h +8 -7
- data/ext/multi_compress/vendor/zstd/lib/compress/zstd_compress_superblock.c +254 -139
- data/ext/multi_compress/vendor/zstd/lib/compress/zstd_compress_superblock.h +1 -1
- data/ext/multi_compress/vendor/zstd/lib/compress/zstd_cwksp.h +184 -95
- data/ext/multi_compress/vendor/zstd/lib/compress/zstd_double_fast.c +163 -81
- data/ext/multi_compress/vendor/zstd/lib/compress/zstd_double_fast.h +18 -14
- data/ext/multi_compress/vendor/zstd/lib/compress/zstd_fast.c +507 -197
- data/ext/multi_compress/vendor/zstd/lib/compress/zstd_fast.h +7 -14
- data/ext/multi_compress/vendor/zstd/lib/compress/zstd_lazy.c +579 -484
- data/ext/multi_compress/vendor/zstd/lib/compress/zstd_lazy.h +133 -65
- data/ext/multi_compress/vendor/zstd/lib/compress/zstd_ldm.c +61 -40
- data/ext/multi_compress/vendor/zstd/lib/compress/zstd_ldm.h +7 -15
- data/ext/multi_compress/vendor/zstd/lib/compress/zstd_ldm_geartab.h +1 -1
- data/ext/multi_compress/vendor/zstd/lib/compress/zstd_opt.c +352 -218
- data/ext/multi_compress/vendor/zstd/lib/compress/zstd_opt.h +37 -21
- data/ext/multi_compress/vendor/zstd/lib/compress/zstd_preSplit.c +238 -0
- data/ext/multi_compress/vendor/zstd/lib/compress/zstd_preSplit.h +33 -0
- data/ext/multi_compress/vendor/zstd/lib/compress/zstdmt_compress.c +239 -175
- data/ext/multi_compress/vendor/zstd/lib/compress/zstdmt_compress.h +5 -16
- data/ext/multi_compress/vendor/zstd/lib/decompress/huf_decompress.c +543 -488
- data/ext/multi_compress/vendor/zstd/lib/decompress/huf_decompress_amd64.S +78 -61
- data/ext/multi_compress/vendor/zstd/lib/decompress/zstd_ddict.c +4 -4
- data/ext/multi_compress/vendor/zstd/lib/decompress/zstd_ddict.h +1 -1
- data/ext/multi_compress/vendor/zstd/lib/decompress/zstd_decompress.c +295 -115
- data/ext/multi_compress/vendor/zstd/lib/decompress/zstd_decompress_block.c +430 -293
- data/ext/multi_compress/vendor/zstd/lib/decompress/zstd_decompress_block.h +7 -2
- data/ext/multi_compress/vendor/zstd/lib/decompress/zstd_decompress_internal.h +11 -7
- data/ext/multi_compress/vendor/zstd/lib/deprecated/zbuff.h +1 -1
- data/ext/multi_compress/vendor/zstd/lib/deprecated/zbuff_common.c +1 -1
- data/ext/multi_compress/vendor/zstd/lib/deprecated/zbuff_compress.c +1 -1
- data/ext/multi_compress/vendor/zstd/lib/deprecated/zbuff_decompress.c +3 -1
- data/ext/multi_compress/vendor/zstd/lib/dictBuilder/cover.c +95 -46
- data/ext/multi_compress/vendor/zstd/lib/dictBuilder/cover.h +3 -9
- data/ext/multi_compress/vendor/zstd/lib/dictBuilder/divsufsort.h +0 -10
- data/ext/multi_compress/vendor/zstd/lib/dictBuilder/fastcover.c +4 -4
- data/ext/multi_compress/vendor/zstd/lib/dictBuilder/zdict.c +25 -97
- data/ext/multi_compress/vendor/zstd/lib/dll/example/Makefile +1 -1
- data/ext/multi_compress/vendor/zstd/lib/dll/example/README.md +1 -1
- data/ext/multi_compress/vendor/zstd/lib/legacy/zstd_legacy.h +38 -1
- data/ext/multi_compress/vendor/zstd/lib/legacy/zstd_v01.c +19 -50
- data/ext/multi_compress/vendor/zstd/lib/legacy/zstd_v01.h +1 -1
- data/ext/multi_compress/vendor/zstd/lib/legacy/zstd_v02.c +27 -80
- data/ext/multi_compress/vendor/zstd/lib/legacy/zstd_v02.h +1 -1
- data/ext/multi_compress/vendor/zstd/lib/legacy/zstd_v03.c +28 -83
- data/ext/multi_compress/vendor/zstd/lib/legacy/zstd_v03.h +1 -1
- data/ext/multi_compress/vendor/zstd/lib/legacy/zstd_v04.c +25 -74
- data/ext/multi_compress/vendor/zstd/lib/legacy/zstd_v04.h +1 -1
- data/ext/multi_compress/vendor/zstd/lib/legacy/zstd_v05.c +31 -76
- data/ext/multi_compress/vendor/zstd/lib/legacy/zstd_v05.h +1 -1
- data/ext/multi_compress/vendor/zstd/lib/legacy/zstd_v06.c +44 -88
- data/ext/multi_compress/vendor/zstd/lib/legacy/zstd_v06.h +1 -1
- data/ext/multi_compress/vendor/zstd/lib/legacy/zstd_v07.c +33 -84
- data/ext/multi_compress/vendor/zstd/lib/legacy/zstd_v07.h +1 -1
- data/ext/multi_compress/vendor/zstd/lib/libzstd.mk +65 -33
- data/ext/multi_compress/vendor/zstd/lib/libzstd.pc.in +5 -5
- data/ext/multi_compress/vendor/zstd/lib/module.modulemap +13 -3
- data/ext/multi_compress/vendor/zstd/lib/zdict.h +65 -36
- data/ext/multi_compress/vendor/zstd/lib/zstd.h +890 -267
- data/ext/multi_compress/vendor/zstd/lib/zstd_errors.h +28 -16
- data/lib/multi_compress/version.rb +1 -1
- metadata +29 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e6af5cef6e9b15c5b0e11a148b0543377c0ad332e710083950bca7cb3d49e70e
|
|
4
|
+
data.tar.gz: 6722c74ed13eabcdb3a4a7ca81cd12b9d3f286f11d00e73de759861db198f2a2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: bca66c39d081538682abd1a45862f4d141605f028b3f233ec886d21f3b38c84000956275b73303c00fda5755f37796c3bcd8bb533db32a0f12b272107ed298c1
|
|
7
|
+
data.tar.gz: 209cebbbbc4be03bd48eea3d59ec1254502db4a8a5e9109b5f03425cc2f05d474ab7f250d2a2ecfaba36f1c6ac9686b159cf0433bb9c50bd84aecffe62ab365e
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.3.3]
|
|
4
|
+
|
|
5
|
+
### Changed
|
|
6
|
+
- Updated vendored native libraries to **zstd 1.5.7** and **brotli 1.2.0**.
|
|
7
|
+
- Updated README / GET_STARTED examples so documented runtime versions match `MultiCompress.version(...)`.
|
|
8
|
+
- Added third-party license notices for the vendored C libraries.
|
|
9
|
+
|
|
3
10
|
## [0.3.2]
|
|
4
11
|
|
|
5
12
|
### Changed
|
|
@@ -59,9 +66,9 @@
|
|
|
59
66
|
- Optional `./build.sh --test`, `./build.sh --valgrind`, and `./build.sh --sanitize` modes
|
|
60
67
|
|
|
61
68
|
### Changed
|
|
62
|
-
-
|
|
63
|
-
- This
|
|
64
|
-
-
|
|
69
|
+
- Historical note for the 0.2.2 release line: vendored **zstd** was pinned to **1.5.2**.
|
|
70
|
+
- This restored reliable `MultiCompress::Zstd.train_dictionary(...)` behavior on tested platforms at the time, including arm64-darwin.
|
|
71
|
+
- Later releases moved forward after the native-library upgrade path was revalidated.
|
|
65
72
|
|
|
66
73
|
### Changed
|
|
67
74
|
- Documentation now matches current runtime behavior:
|
data/GET_STARTED.md
CHANGED
|
@@ -400,7 +400,7 @@ end
|
|
|
400
400
|
|
|
401
401
|
Dramatically improves compression on small, similar data (JSON APIs, configs, logs).
|
|
402
402
|
|
|
403
|
-
**Important**: Dictionary training is available for **Zstd** in the current release (vendored zstd **1.5.
|
|
403
|
+
**Important**: Dictionary training is available for **Zstd** in the current release (vendored zstd **1.5.7**). Brotli dictionaries can be used, but this gem does not expose Brotli training through `train_dictionary`.
|
|
404
404
|
|
|
405
405
|
### Training Dictionary (Zstd)
|
|
406
406
|
|
|
@@ -677,9 +677,9 @@ MultiCompress.available?(:zstd) # => true
|
|
|
677
677
|
MultiCompress.available?(:fake) # => false
|
|
678
678
|
|
|
679
679
|
# Get library versions
|
|
680
|
-
MultiCompress.version(:zstd) # => "1.5.
|
|
680
|
+
MultiCompress.version(:zstd) # => "1.5.7"
|
|
681
681
|
MultiCompress.version(:lz4) # => "1.10.0"
|
|
682
|
-
MultiCompress.version(:brotli) # => "1.
|
|
682
|
+
MultiCompress.version(:brotli) # => "1.2.0"
|
|
683
683
|
```
|
|
684
684
|
|
|
685
685
|
### Data Integrity
|
data/README.md
CHANGED
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
Modern compression technology: **zstd**, **lz4**, **brotli** — unified compression platform with native C performance, **fiber-friendly** for modern async Ruby stacks.
|
|
8
8
|
|
|
9
9
|
Bundled library versions in the current release:
|
|
10
|
-
- **zstd 1.5.
|
|
10
|
+
- **zstd 1.5.7**
|
|
11
11
|
- **lz4 1.10.0**
|
|
12
|
-
- **brotli 1.
|
|
12
|
+
- **brotli 1.2.0**
|
|
13
13
|
|
|
14
14
|
📖 **[Get Started →](GET_STARTED.md)** — Complete technology overview, algorithms, and implementation details
|
|
15
15
|
|
|
@@ -88,70 +88,79 @@ If `max_output_size:` is omitted, one-shot calls use `MultiCompress.config.max_o
|
|
|
88
88
|
|
|
89
89
|
## Benchmark Results
|
|
90
90
|
|
|
91
|
-
>
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
91
|
+
> Benchmark numbers are environment-dependent. The tables below were generated with **MultiCompress 0.3.2** using vendored **zstd 1.5.7**, **lz4 1.10.0**, and **brotli 1.2.0** on **Ruby 3.1.7 / arm64-darwin24**, 200 iterations per test.
|
|
92
|
+
>
|
|
93
|
+
> Use these numbers as relative guidance, not absolute guarantees. In this run, **lz4** is consistently the fastest, **zstd** gives the best speed/ratio balance, and **brotli** gives the smallest output size but is not optimized for speed-first paths.
|
|
94
|
+
|
|
95
|
+
Performance comparison against Ruby's built-in zlib compression:
|
|
96
|
+
|
|
97
|
+
### 🗜️ Compression ratio (%, lower is better)
|
|
98
|
+
|
|
99
|
+
| Configuration | zlib | lz4 | zstd | brotli |
|
|
100
|
+
|---|---:|---:|---:|---:|
|
|
101
|
+
| Small JSON (~10KB, GC) | 9.4% | 16.1% | 6.9% | 6.1% |
|
|
102
|
+
| Small text (~10KB, GC) | 3.1% | 4.6% | 3.2% | 2.6% |
|
|
103
|
+
| Small JSON (~10KB, no GC) | 9.4% | 16.1% | 6.9% | 6.1% |
|
|
104
|
+
| Small text (~10KB, no GC) | 3.1% | 4.6% | 3.2% | 2.6% |
|
|
105
|
+
| Medium JSON (~370KB, GC) | 8.5% | 15.7% | 6.6% | 5.4% |
|
|
106
|
+
| Medium logs (~168KB, GC) | 8.6% | 17.2% | 5.3% | 3.3% |
|
|
107
|
+
| Medium JSON (~370KB, no GC) | 8.5% | 15.7% | 6.6% | 5.4% |
|
|
108
|
+
| Medium logs (~168KB, no GC) | 8.6% | 17.2% | 5.3% | 3.3% |
|
|
109
|
+
| Large JSON (~1.6MB, GC) | 8.1% | 15.1% | 6.1% | 5.6% |
|
|
110
|
+
| Large logs (~600KB, GC) | 7.6% | 16.0% | 2.9% | 2.0% |
|
|
111
|
+
| Large JSON (~1.6MB, no GC) | 8.1% | 15.1% | 6.1% | 5.6% |
|
|
112
|
+
| Large logs (~600KB, no GC) | 7.6% | 16.0% | 2.9% | 2.0% |
|
|
113
|
+
|
|
114
|
+
### ⚡ Total time (compress + decompress, ms — lower is faster)
|
|
115
|
+
|
|
116
|
+
| Configuration | zlib | lz4 | zstd | brotli |
|
|
117
|
+
|---|---:|---:|---:|---:|
|
|
118
|
+
| Small JSON (~10KB, GC) | 0.05 | 0.01 | 0.02 | 0.14 |
|
|
119
|
+
| Small text (~10KB, GC) | 0.04 | 0.00 | 0.01 | 0.12 |
|
|
120
|
+
| Small JSON (~10KB, no GC) | 0.05 | 0.01 | 0.02 | 0.14 |
|
|
121
|
+
| Small text (~10KB, no GC) | 0.04 | 0.00 | 0.01 | 0.11 |
|
|
122
|
+
| Medium JSON (~370KB, GC) | 2.60 | 0.29 | 0.41 | 2.45 |
|
|
123
|
+
| Medium logs (~168KB, GC) | 1.28 | 0.13 | 0.17 | 0.96 |
|
|
124
|
+
| Medium JSON (~370KB, no GC) | 2.62 | 0.27 | 0.39 | 2.41 |
|
|
125
|
+
| Medium logs (~168KB, no GC) | 1.19 | 0.13 | 0.17 | 1.08 |
|
|
126
|
+
| Large JSON (~1.6MB, GC) | 11.60 | 1.30 | 1.81 | 11.12 |
|
|
127
|
+
| Large logs (~600KB, GC) | 4.11 | 0.41 | 0.46 | 2.99 |
|
|
128
|
+
| Large JSON (~1.6MB, no GC) | 11.26 | 1.24 | 1.77 | 10.77 |
|
|
129
|
+
| Large logs (~600KB, no GC) | 4.01 | 0.42 | 0.45 | 2.90 |
|
|
130
|
+
|
|
131
|
+
### 📊 Speedup vs zlib by total time (higher is better)
|
|
132
|
+
|
|
133
|
+
| Configuration | zlib | lz4 | zstd | brotli |
|
|
134
|
+
|---|---:|---:|---:|---:|
|
|
135
|
+
| Small JSON (~10KB, GC) | 1.00x | 5.00x | 2.50x | 0.36x |
|
|
136
|
+
| Small text (~10KB, GC) | 1.00x | N/A | 4.00x | 0.33x |
|
|
137
|
+
| Small JSON (~10KB, no GC) | 1.00x | 5.00x | 2.50x | 0.36x |
|
|
138
|
+
| Small text (~10KB, no GC) | 1.00x | N/A | 4.00x | 0.36x |
|
|
139
|
+
| Medium JSON (~370KB, GC) | 1.00x | 8.97x | 6.34x | 1.06x |
|
|
140
|
+
| Medium logs (~168KB, GC) | 1.00x | 9.85x | 7.53x | 1.33x |
|
|
141
|
+
| Medium JSON (~370KB, no GC) | 1.00x | 9.70x | 6.72x | 1.09x |
|
|
142
|
+
| Medium logs (~168KB, no GC) | 1.00x | 9.15x | 7.00x | 1.10x |
|
|
143
|
+
| Large JSON (~1.6MB, GC) | 1.00x | 8.92x | 6.41x | 1.04x |
|
|
144
|
+
| Large logs (~600KB, GC) | 1.00x | 10.02x | 8.93x | 1.37x |
|
|
145
|
+
| Large JSON (~1.6MB, no GC) | 1.00x | 9.08x | 6.36x | 1.05x |
|
|
146
|
+
| Large logs (~600KB, no GC) | 1.00x | 9.55x | 8.91x | 1.38x |
|
|
147
|
+
|
|
148
|
+
### 📏 Compressed size (bytes, lower is better)
|
|
149
|
+
|
|
150
|
+
| Configuration | zlib | lz4 | zstd | brotli |
|
|
151
|
+
|---|---:|---:|---:|---:|
|
|
152
|
+
| Small JSON (~10KB, GC) | 900 | 1544 | 665 | 583 |
|
|
153
|
+
| Small text (~10KB, GC) | 310 | 461 | 322 | 256 |
|
|
154
|
+
| Small JSON (~10KB, no GC) | 900 | 1544 | 665 | 583 |
|
|
155
|
+
| Small text (~10KB, no GC) | 310 | 461 | 322 | 256 |
|
|
156
|
+
| Medium JSON (~370KB, GC) | 31524 | 57986 | 24557 | 20122 |
|
|
157
|
+
| Medium logs (~168KB, GC) | 14488 | 28950 | 8985 | 5549 |
|
|
158
|
+
| Medium JSON (~370KB, no GC) | 31524 | 57986 | 24557 | 20122 |
|
|
159
|
+
| Medium logs (~168KB, no GC) | 14488 | 28950 | 8985 | 5549 |
|
|
160
|
+
| Large JSON (~1.6MB, GC) | 133275 | 250026 | 100965 | 92591 |
|
|
161
|
+
| Large logs (~600KB, GC) | 45432 | 96130 | 17385 | 12250 |
|
|
162
|
+
| Large JSON (~1.6MB, no GC) | 133275 | 250026 | 100965 | 92591 |
|
|
163
|
+
| Large logs (~600KB, no GC) | 45432 | 96130 | 17385 | 12250 |
|
|
155
164
|
|
|
156
165
|
**Dependencies for benchmarking:**
|
|
157
166
|
- `memory_profiler` — Memory usage analysis
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Third-Party Notices
|
|
2
|
+
|
|
3
|
+
MultiCompress vendors C sources from upstream compression libraries so the gem can build without system-level compression packages. MultiCompress's own Ruby code and extension glue are MIT-licensed, but vendored third-party sources keep their upstream licenses.
|
|
4
|
+
|
|
5
|
+
## Vendored native libraries
|
|
6
|
+
|
|
7
|
+
| Library | Vendored version | Vendored source scope | Upstream license used by MultiCompress |
|
|
8
|
+
|---|---:|---|---|
|
|
9
|
+
| Zstandard (`zstd`) | 1.5.7 | `lib/` | BSD side of upstream BSD OR GPLv2 licensing |
|
|
10
|
+
| LZ4 | 1.10.0 | `lib/` | BSD 2-Clause |
|
|
11
|
+
| Brotli | 1.2.0 | `c/common`, `c/enc`, `c/dec`, `c/include` | MIT |
|
|
12
|
+
|
|
13
|
+
## Notes
|
|
14
|
+
|
|
15
|
+
- Zstandard changed copyright wording from older Facebook/Yann Collet headers to `Meta Platforms, Inc. and affiliates` in newer releases. This is a copyright-owner notice change, not a prohibition on use.
|
|
16
|
+
- Do not imply that Facebook, Meta, Google, Yann Collet, or upstream contributors endorse MultiCompress.
|
|
17
|
+
- When distributing source or binary builds, keep the vendored source notices and this file in the package.
|
|
18
|
+
- LZ4's repository contains GPL-licensed areas outside `lib/`; MultiCompress vendors only `lib/`, which upstream documents as the BSD 2-Clause integration area.
|
|
19
|
+
|
|
20
|
+
## Upstream projects
|
|
21
|
+
|
|
22
|
+
- Zstandard: https://github.com/facebook/zstd
|
|
23
|
+
- LZ4: https://github.com/lz4/lz4
|
|
24
|
+
- Brotli: https://github.com/google/brotli
|
|
@@ -10,6 +10,14 @@ FORCE_VENDORED = arg_config("--force-vendored") ||
|
|
|
10
10
|
ZSTD_SUBDIRS = %w[lib/common lib/compress lib/decompress lib/dictBuilder].freeze
|
|
11
11
|
BROTLI_SUBDIRS = %w[c/common c/enc c/dec].freeze
|
|
12
12
|
LZ4_SOURCES = %w[lz4.c lz4hc.c lz4frame.c].freeze
|
|
13
|
+
BROTLI_STATIC_INIT_SOURCES = %w[
|
|
14
|
+
c/enc/static_init.c
|
|
15
|
+
c/dec/static_init.c
|
|
16
|
+
].freeze
|
|
17
|
+
BROTLI_STATIC_INIT_WRAPPERS = %w[
|
|
18
|
+
brotli_enc_static_init.c
|
|
19
|
+
brotli_dec_static_init.c
|
|
20
|
+
].freeze
|
|
13
21
|
|
|
14
22
|
def find_vendor_dir
|
|
15
23
|
candidates = [
|
|
@@ -116,7 +124,20 @@ def collect_vendor_sources(zstd_dir, lz4_dir, brotli_dir)
|
|
|
116
124
|
|
|
117
125
|
brotli_srcs = BROTLI_SUBDIRS.flat_map { |d| Dir[File.join(brotli_dir, d, "*.c")] }
|
|
118
126
|
|
|
119
|
-
|
|
127
|
+
# Brotli 1.2.0 has both c/enc/static_init.c and c/dec/static_init.c.
|
|
128
|
+
# mkmf builds object files by basename, so compiling both as static_init.c
|
|
129
|
+
# makes one object shadow the other. Use unique wrapper translation units
|
|
130
|
+
# instead; otherwise the decoder static init can be skipped and crash at runtime.
|
|
131
|
+
brotli_static_init_paths = BROTLI_STATIC_INIT_SOURCES.map do |relative_path|
|
|
132
|
+
File.join(brotli_dir, relative_path)
|
|
133
|
+
end
|
|
134
|
+
brotli_srcs -= brotli_static_init_paths
|
|
135
|
+
|
|
136
|
+
brotli_static_init_wrappers = BROTLI_STATIC_INIT_WRAPPERS.map do |file|
|
|
137
|
+
File.join(__dir__, file)
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
zstd_srcs + lz4_srcs + brotli_srcs + brotli_static_init_wrappers
|
|
120
141
|
end
|
|
121
142
|
|
|
122
143
|
def add_include_dirs(zstd_dir, lz4_dir, brotli_dir)
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
zstd=1.5.
|
|
1
|
+
zstd=1.5.7
|
|
2
2
|
lz4=1.10.0
|
|
3
|
-
brotli=1.
|
|
3
|
+
brotli=1.2.0
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
Copyright (c) 2009, 2010, 2013-2016 by the Brotli Authors.
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
4
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
5
|
+
in the Software without restriction, including without limitation the rights
|
|
6
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
7
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
8
|
+
furnished to do so, subject to the following conditions:
|
|
9
|
+
|
|
10
|
+
The above copyright notice and this permission notice shall be included in
|
|
11
|
+
all copies or substantial portions of the Software.
|
|
12
|
+
|
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
14
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
15
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
16
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
17
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
18
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
19
|
+
THE SOFTWARE.
|
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
|
|
7
7
|
#include "constants.h"
|
|
8
8
|
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
9
|
+
const BROTLI_MODEL("small")
|
|
10
|
+
BrotliPrefixCodeRange _kBrotliPrefixCodeRanges[BROTLI_NUM_BLOCK_LEN_SYMBOLS] = {
|
|
11
|
+
{1, 2}, {5, 2}, {9, 2}, {13, 2}, {17, 3}, {25, 3},
|
|
12
|
+
{33, 3}, {41, 3}, {49, 4}, {65, 4}, {81, 4}, {97, 4},
|
|
13
|
+
{113, 5}, {145, 5}, {177, 5}, {209, 5}, {241, 6}, {305, 6},
|
|
14
|
+
{369, 7}, {497, 8}, {753, 9}, {1265, 10}, {2289, 11}, {4337, 12},
|
|
15
|
+
{8433, 13}, {16625, 24}};
|
|
@@ -12,9 +12,6 @@
|
|
|
12
12
|
#ifndef BROTLI_COMMON_CONSTANTS_H_
|
|
13
13
|
#define BROTLI_COMMON_CONSTANTS_H_
|
|
14
14
|
|
|
15
|
-
#include <brotli/port.h>
|
|
16
|
-
#include <brotli/types.h>
|
|
17
|
-
|
|
18
15
|
#include "platform.h"
|
|
19
16
|
|
|
20
17
|
/* Specification: 7.3. Encoding of the context map */
|
|
@@ -195,7 +192,7 @@ typedef struct {
|
|
|
195
192
|
} BrotliPrefixCodeRange;
|
|
196
193
|
|
|
197
194
|
/* "Soft-private", it is exported, but not "advertised" as API. */
|
|
198
|
-
BROTLI_COMMON_API extern const
|
|
199
|
-
|
|
195
|
+
BROTLI_COMMON_API extern const BROTLI_MODEL("small")
|
|
196
|
+
BrotliPrefixCodeRange _kBrotliPrefixCodeRanges[BROTLI_NUM_BLOCK_LEN_SYMBOLS];
|
|
200
197
|
|
|
201
198
|
#endif /* BROTLI_COMMON_CONSTANTS_H_ */
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#include "context.h"
|
|
2
2
|
|
|
3
|
-
#include
|
|
3
|
+
#include "platform.h"
|
|
4
4
|
|
|
5
5
|
/* Common context lookup table for all context modes. */
|
|
6
|
-
const uint8_t _kBrotliContextLookupTable[2048] = {
|
|
6
|
+
const BROTLI_MODEL("small") uint8_t _kBrotliContextLookupTable[2048] = {
|
|
7
7
|
/* CONTEXT_LSB6, last byte. */
|
|
8
8
|
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
|
|
9
9
|
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
|