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.
Files changed (210) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +10 -3
  3. data/GET_STARTED.md +3 -3
  4. data/README.md +75 -66
  5. data/THIRD_PARTY_NOTICES.md +24 -0
  6. data/ext/multi_compress/brotli_dec_static_init.c +3 -0
  7. data/ext/multi_compress/brotli_enc_static_init.c +3 -0
  8. data/ext/multi_compress/extconf.rb +22 -1
  9. data/ext/multi_compress/vendor/.vendored +2 -2
  10. data/ext/multi_compress/vendor/brotli/LICENSE +19 -0
  11. data/ext/multi_compress/vendor/brotli/c/common/constants.c +7 -7
  12. data/ext/multi_compress/vendor/brotli/c/common/constants.h +2 -5
  13. data/ext/multi_compress/vendor/brotli/c/common/context.c +2 -2
  14. data/ext/multi_compress/vendor/brotli/c/common/context.h +1 -2
  15. data/ext/multi_compress/vendor/brotli/c/common/dictionary.c +4 -5856
  16. data/ext/multi_compress/vendor/brotli/c/common/dictionary.h +1 -2
  17. data/ext/multi_compress/vendor/brotli/c/common/dictionary_inc.h +5847 -0
  18. data/ext/multi_compress/vendor/brotli/c/common/platform.c +0 -4
  19. data/ext/multi_compress/vendor/brotli/c/common/platform.h +182 -43
  20. data/ext/multi_compress/vendor/brotli/c/common/shared_dictionary.c +3 -7
  21. data/ext/multi_compress/vendor/brotli/c/common/shared_dictionary_internal.h +1 -1
  22. data/ext/multi_compress/vendor/brotli/c/common/static_init.h +56 -0
  23. data/ext/multi_compress/vendor/brotli/c/common/transform.c +6 -4
  24. data/ext/multi_compress/vendor/brotli/c/common/transform.h +1 -2
  25. data/ext/multi_compress/vendor/brotli/c/common/version.h +3 -3
  26. data/ext/multi_compress/vendor/brotli/c/dec/bit_reader.c +2 -3
  27. data/ext/multi_compress/vendor/brotli/c/dec/bit_reader.h +0 -4
  28. data/ext/multi_compress/vendor/brotli/c/dec/decode.c +128 -39
  29. data/ext/multi_compress/vendor/brotli/c/dec/huffman.c +2 -5
  30. data/ext/multi_compress/vendor/brotli/c/dec/huffman.h +0 -2
  31. data/ext/multi_compress/vendor/brotli/c/dec/prefix.c +67 -0
  32. data/ext/multi_compress/vendor/brotli/c/dec/prefix.h +18 -708
  33. data/ext/multi_compress/vendor/brotli/c/dec/prefix_inc.h +707 -0
  34. data/ext/multi_compress/vendor/brotli/c/dec/state.c +18 -15
  35. data/ext/multi_compress/vendor/brotli/c/dec/state.h +2 -6
  36. data/ext/multi_compress/vendor/brotli/c/dec/static_init.c +53 -0
  37. data/ext/multi_compress/vendor/brotli/c/dec/static_init.h +30 -0
  38. data/ext/multi_compress/vendor/brotli/c/enc/backward_references.c +32 -8
  39. data/ext/multi_compress/vendor/brotli/c/enc/backward_references.h +1 -5
  40. data/ext/multi_compress/vendor/brotli/c/enc/backward_references_hq.c +15 -15
  41. data/ext/multi_compress/vendor/brotli/c/enc/backward_references_hq.h +1 -5
  42. data/ext/multi_compress/vendor/brotli/c/enc/bit_cost.c +28 -4
  43. data/ext/multi_compress/vendor/brotli/c/enc/bit_cost.h +8 -40
  44. data/ext/multi_compress/vendor/brotli/c/enc/bit_cost_inc.h +1 -1
  45. data/ext/multi_compress/vendor/brotli/c/enc/block_splitter.c +9 -12
  46. data/ext/multi_compress/vendor/brotli/c/enc/block_splitter.h +0 -3
  47. data/ext/multi_compress/vendor/brotli/c/enc/block_splitter_inc.h +14 -8
  48. data/ext/multi_compress/vendor/brotli/c/enc/brotli_bit_stream.c +10 -9
  49. data/ext/multi_compress/vendor/brotli/c/enc/brotli_bit_stream.h +0 -6
  50. data/ext/multi_compress/vendor/brotli/c/enc/cluster.c +0 -2
  51. data/ext/multi_compress/vendor/brotli/c/enc/cluster.h +0 -2
  52. data/ext/multi_compress/vendor/brotli/c/enc/command.c +1 -1
  53. data/ext/multi_compress/vendor/brotli/c/enc/command.h +8 -10
  54. data/ext/multi_compress/vendor/brotli/c/enc/compound_dictionary.c +3 -5
  55. data/ext/multi_compress/vendor/brotli/c/enc/compound_dictionary.h +1 -4
  56. data/ext/multi_compress/vendor/brotli/c/enc/compress_fragment.c +3 -13
  57. data/ext/multi_compress/vendor/brotli/c/enc/compress_fragment.h +0 -2
  58. data/ext/multi_compress/vendor/brotli/c/enc/compress_fragment_two_pass.c +5 -15
  59. data/ext/multi_compress/vendor/brotli/c/enc/compress_fragment_two_pass.h +0 -2
  60. data/ext/multi_compress/vendor/brotli/c/enc/dictionary_hash.c +127 -1830
  61. data/ext/multi_compress/vendor/brotli/c/enc/dictionary_hash.h +23 -3
  62. data/ext/multi_compress/vendor/brotli/c/enc/dictionary_hash_inc.h +1829 -0
  63. data/ext/multi_compress/vendor/brotli/c/enc/encode.c +77 -52
  64. data/ext/multi_compress/vendor/brotli/c/enc/encoder_dict.c +9 -7
  65. data/ext/multi_compress/vendor/brotli/c/enc/encoder_dict.h +2 -4
  66. data/ext/multi_compress/vendor/brotli/c/enc/entropy_encode.c +3 -6
  67. data/ext/multi_compress/vendor/brotli/c/enc/entropy_encode.h +2 -4
  68. data/ext/multi_compress/vendor/brotli/c/enc/entropy_encode_static.h +18 -12
  69. data/ext/multi_compress/vendor/brotli/c/enc/fast_log.c +1 -1
  70. data/ext/multi_compress/vendor/brotli/c/enc/fast_log.h +2 -3
  71. data/ext/multi_compress/vendor/brotli/c/enc/find_match_length.h +0 -2
  72. data/ext/multi_compress/vendor/brotli/c/enc/hash.h +38 -31
  73. data/ext/multi_compress/vendor/brotli/c/enc/hash_base.h +38 -0
  74. data/ext/multi_compress/vendor/brotli/c/enc/hash_forgetful_chain_inc.h +11 -1
  75. data/ext/multi_compress/vendor/brotli/c/enc/hash_longest_match64_inc.h +24 -7
  76. data/ext/multi_compress/vendor/brotli/c/enc/hash_longest_match64_simd_inc.h +304 -0
  77. data/ext/multi_compress/vendor/brotli/c/enc/hash_longest_match_inc.h +30 -11
  78. data/ext/multi_compress/vendor/brotli/c/enc/hash_longest_match_quickly_inc.h +4 -0
  79. data/ext/multi_compress/vendor/brotli/c/enc/hash_longest_match_simd_inc.h +278 -0
  80. data/ext/multi_compress/vendor/brotli/c/enc/histogram.c +1 -0
  81. data/ext/multi_compress/vendor/brotli/c/enc/histogram.h +0 -4
  82. data/ext/multi_compress/vendor/brotli/c/enc/literal_cost.c +4 -6
  83. data/ext/multi_compress/vendor/brotli/c/enc/literal_cost.h +0 -2
  84. data/ext/multi_compress/vendor/brotli/c/enc/matching_tag_mask.h +69 -0
  85. data/ext/multi_compress/vendor/brotli/c/enc/memory.c +0 -5
  86. data/ext/multi_compress/vendor/brotli/c/enc/memory.h +0 -4
  87. data/ext/multi_compress/vendor/brotli/c/enc/metablock.c +7 -9
  88. data/ext/multi_compress/vendor/brotli/c/enc/metablock.h +3 -3
  89. data/ext/multi_compress/vendor/brotli/c/enc/metablock_inc.h +4 -4
  90. data/ext/multi_compress/vendor/brotli/c/enc/params.h +0 -1
  91. data/ext/multi_compress/vendor/brotli/c/enc/prefix.h +0 -2
  92. data/ext/multi_compress/vendor/brotli/c/enc/quality.h +17 -10
  93. data/ext/multi_compress/vendor/brotli/c/enc/ringbuffer.h +1 -4
  94. data/ext/multi_compress/vendor/brotli/c/enc/state.h +2 -2
  95. data/ext/multi_compress/vendor/brotli/c/enc/static_dict.c +5 -11
  96. data/ext/multi_compress/vendor/brotli/c/enc/static_dict.h +1 -3
  97. data/ext/multi_compress/vendor/brotli/c/enc/static_dict_lut.c +224 -0
  98. data/ext/multi_compress/vendor/brotli/c/enc/static_dict_lut.h +20 -5837
  99. data/ext/multi_compress/vendor/brotli/c/enc/static_dict_lut_inc.h +5830 -0
  100. data/ext/multi_compress/vendor/brotli/c/enc/static_init.c +59 -0
  101. data/ext/multi_compress/vendor/brotli/c/enc/static_init.h +30 -0
  102. data/ext/multi_compress/vendor/brotli/c/enc/static_init_lazy.cc +26 -0
  103. data/ext/multi_compress/vendor/brotli/c/enc/utf8_util.c +1 -1
  104. data/ext/multi_compress/vendor/brotli/c/enc/utf8_util.h +0 -2
  105. data/ext/multi_compress/vendor/brotli/c/enc/write_bits.h +0 -2
  106. data/ext/multi_compress/vendor/brotli/c/include/brotli/decode.h +1 -1
  107. data/ext/multi_compress/vendor/brotli/c/include/brotli/encode.h +5 -1
  108. data/ext/multi_compress/vendor/brotli/c/include/brotli/port.h +4 -7
  109. data/ext/multi_compress/vendor/brotli/c/include/brotli/types.h +2 -2
  110. data/ext/multi_compress/vendor/lz4/LICENSE +12 -0
  111. data/ext/multi_compress/vendor/zstd/COPYING +339 -0
  112. data/ext/multi_compress/vendor/zstd/LICENSE +30 -0
  113. data/ext/multi_compress/vendor/zstd/lib/Makefile +67 -35
  114. data/ext/multi_compress/vendor/zstd/lib/README.md +33 -2
  115. data/ext/multi_compress/vendor/zstd/lib/common/allocations.h +55 -0
  116. data/ext/multi_compress/vendor/zstd/lib/common/bits.h +205 -0
  117. data/ext/multi_compress/vendor/zstd/lib/common/bitstream.h +84 -108
  118. data/ext/multi_compress/vendor/zstd/lib/common/compiler.h +170 -41
  119. data/ext/multi_compress/vendor/zstd/lib/common/cpu.h +37 -1
  120. data/ext/multi_compress/vendor/zstd/lib/common/debug.c +7 -1
  121. data/ext/multi_compress/vendor/zstd/lib/common/debug.h +21 -21
  122. data/ext/multi_compress/vendor/zstd/lib/common/entropy_common.c +12 -40
  123. data/ext/multi_compress/vendor/zstd/lib/common/error_private.c +10 -2
  124. data/ext/multi_compress/vendor/zstd/lib/common/error_private.h +46 -47
  125. data/ext/multi_compress/vendor/zstd/lib/common/fse.h +8 -100
  126. data/ext/multi_compress/vendor/zstd/lib/common/fse_decompress.c +28 -116
  127. data/ext/multi_compress/vendor/zstd/lib/common/huf.h +79 -166
  128. data/ext/multi_compress/vendor/zstd/lib/common/mem.h +46 -66
  129. data/ext/multi_compress/vendor/zstd/lib/common/pool.c +27 -11
  130. data/ext/multi_compress/vendor/zstd/lib/common/pool.h +8 -11
  131. data/ext/multi_compress/vendor/zstd/lib/common/portability_macros.h +45 -11
  132. data/ext/multi_compress/vendor/zstd/lib/common/threading.c +74 -14
  133. data/ext/multi_compress/vendor/zstd/lib/common/threading.h +5 -18
  134. data/ext/multi_compress/vendor/zstd/lib/common/xxhash.c +5 -11
  135. data/ext/multi_compress/vendor/zstd/lib/common/xxhash.h +2411 -1003
  136. data/ext/multi_compress/vendor/zstd/lib/common/zstd_common.c +1 -36
  137. data/ext/multi_compress/vendor/zstd/lib/common/zstd_deps.h +13 -1
  138. data/ext/multi_compress/vendor/zstd/lib/common/zstd_internal.h +13 -182
  139. data/ext/multi_compress/vendor/zstd/lib/common/zstd_trace.h +6 -13
  140. data/ext/multi_compress/vendor/zstd/lib/compress/clevels.h +1 -1
  141. data/ext/multi_compress/vendor/zstd/lib/compress/fse_compress.c +15 -131
  142. data/ext/multi_compress/vendor/zstd/lib/compress/hist.c +11 -1
  143. data/ext/multi_compress/vendor/zstd/lib/compress/hist.h +8 -1
  144. data/ext/multi_compress/vendor/zstd/lib/compress/huf_compress.c +283 -189
  145. data/ext/multi_compress/vendor/zstd/lib/compress/zstd_compress.c +2419 -903
  146. data/ext/multi_compress/vendor/zstd/lib/compress/zstd_compress_internal.h +423 -245
  147. data/ext/multi_compress/vendor/zstd/lib/compress/zstd_compress_literals.c +116 -40
  148. data/ext/multi_compress/vendor/zstd/lib/compress/zstd_compress_literals.h +16 -8
  149. data/ext/multi_compress/vendor/zstd/lib/compress/zstd_compress_sequences.c +10 -10
  150. data/ext/multi_compress/vendor/zstd/lib/compress/zstd_compress_sequences.h +8 -7
  151. data/ext/multi_compress/vendor/zstd/lib/compress/zstd_compress_superblock.c +254 -139
  152. data/ext/multi_compress/vendor/zstd/lib/compress/zstd_compress_superblock.h +1 -1
  153. data/ext/multi_compress/vendor/zstd/lib/compress/zstd_cwksp.h +184 -95
  154. data/ext/multi_compress/vendor/zstd/lib/compress/zstd_double_fast.c +163 -81
  155. data/ext/multi_compress/vendor/zstd/lib/compress/zstd_double_fast.h +18 -14
  156. data/ext/multi_compress/vendor/zstd/lib/compress/zstd_fast.c +507 -197
  157. data/ext/multi_compress/vendor/zstd/lib/compress/zstd_fast.h +7 -14
  158. data/ext/multi_compress/vendor/zstd/lib/compress/zstd_lazy.c +579 -484
  159. data/ext/multi_compress/vendor/zstd/lib/compress/zstd_lazy.h +133 -65
  160. data/ext/multi_compress/vendor/zstd/lib/compress/zstd_ldm.c +61 -40
  161. data/ext/multi_compress/vendor/zstd/lib/compress/zstd_ldm.h +7 -15
  162. data/ext/multi_compress/vendor/zstd/lib/compress/zstd_ldm_geartab.h +1 -1
  163. data/ext/multi_compress/vendor/zstd/lib/compress/zstd_opt.c +352 -218
  164. data/ext/multi_compress/vendor/zstd/lib/compress/zstd_opt.h +37 -21
  165. data/ext/multi_compress/vendor/zstd/lib/compress/zstd_preSplit.c +238 -0
  166. data/ext/multi_compress/vendor/zstd/lib/compress/zstd_preSplit.h +33 -0
  167. data/ext/multi_compress/vendor/zstd/lib/compress/zstdmt_compress.c +239 -175
  168. data/ext/multi_compress/vendor/zstd/lib/compress/zstdmt_compress.h +5 -16
  169. data/ext/multi_compress/vendor/zstd/lib/decompress/huf_decompress.c +543 -488
  170. data/ext/multi_compress/vendor/zstd/lib/decompress/huf_decompress_amd64.S +78 -61
  171. data/ext/multi_compress/vendor/zstd/lib/decompress/zstd_ddict.c +4 -4
  172. data/ext/multi_compress/vendor/zstd/lib/decompress/zstd_ddict.h +1 -1
  173. data/ext/multi_compress/vendor/zstd/lib/decompress/zstd_decompress.c +295 -115
  174. data/ext/multi_compress/vendor/zstd/lib/decompress/zstd_decompress_block.c +430 -293
  175. data/ext/multi_compress/vendor/zstd/lib/decompress/zstd_decompress_block.h +7 -2
  176. data/ext/multi_compress/vendor/zstd/lib/decompress/zstd_decompress_internal.h +11 -7
  177. data/ext/multi_compress/vendor/zstd/lib/deprecated/zbuff.h +1 -1
  178. data/ext/multi_compress/vendor/zstd/lib/deprecated/zbuff_common.c +1 -1
  179. data/ext/multi_compress/vendor/zstd/lib/deprecated/zbuff_compress.c +1 -1
  180. data/ext/multi_compress/vendor/zstd/lib/deprecated/zbuff_decompress.c +3 -1
  181. data/ext/multi_compress/vendor/zstd/lib/dictBuilder/cover.c +95 -46
  182. data/ext/multi_compress/vendor/zstd/lib/dictBuilder/cover.h +3 -9
  183. data/ext/multi_compress/vendor/zstd/lib/dictBuilder/divsufsort.h +0 -10
  184. data/ext/multi_compress/vendor/zstd/lib/dictBuilder/fastcover.c +4 -4
  185. data/ext/multi_compress/vendor/zstd/lib/dictBuilder/zdict.c +25 -97
  186. data/ext/multi_compress/vendor/zstd/lib/dll/example/Makefile +1 -1
  187. data/ext/multi_compress/vendor/zstd/lib/dll/example/README.md +1 -1
  188. data/ext/multi_compress/vendor/zstd/lib/legacy/zstd_legacy.h +38 -1
  189. data/ext/multi_compress/vendor/zstd/lib/legacy/zstd_v01.c +19 -50
  190. data/ext/multi_compress/vendor/zstd/lib/legacy/zstd_v01.h +1 -1
  191. data/ext/multi_compress/vendor/zstd/lib/legacy/zstd_v02.c +27 -80
  192. data/ext/multi_compress/vendor/zstd/lib/legacy/zstd_v02.h +1 -1
  193. data/ext/multi_compress/vendor/zstd/lib/legacy/zstd_v03.c +28 -83
  194. data/ext/multi_compress/vendor/zstd/lib/legacy/zstd_v03.h +1 -1
  195. data/ext/multi_compress/vendor/zstd/lib/legacy/zstd_v04.c +25 -74
  196. data/ext/multi_compress/vendor/zstd/lib/legacy/zstd_v04.h +1 -1
  197. data/ext/multi_compress/vendor/zstd/lib/legacy/zstd_v05.c +31 -76
  198. data/ext/multi_compress/vendor/zstd/lib/legacy/zstd_v05.h +1 -1
  199. data/ext/multi_compress/vendor/zstd/lib/legacy/zstd_v06.c +44 -88
  200. data/ext/multi_compress/vendor/zstd/lib/legacy/zstd_v06.h +1 -1
  201. data/ext/multi_compress/vendor/zstd/lib/legacy/zstd_v07.c +33 -84
  202. data/ext/multi_compress/vendor/zstd/lib/legacy/zstd_v07.h +1 -1
  203. data/ext/multi_compress/vendor/zstd/lib/libzstd.mk +65 -33
  204. data/ext/multi_compress/vendor/zstd/lib/libzstd.pc.in +5 -5
  205. data/ext/multi_compress/vendor/zstd/lib/module.modulemap +13 -3
  206. data/ext/multi_compress/vendor/zstd/lib/zdict.h +65 -36
  207. data/ext/multi_compress/vendor/zstd/lib/zstd.h +890 -267
  208. data/ext/multi_compress/vendor/zstd/lib/zstd_errors.h +28 -16
  209. data/lib/multi_compress/version.rb +1 -1
  210. metadata +29 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 23ab6bacd75b21b5cfbf5b7b3121428c18060bd9e097f815438af6c8bafd8883
4
- data.tar.gz: 90321202358a43bb732077aa1f28b8a9e5d756e27067df851671883a21eb1470
3
+ metadata.gz: e6af5cef6e9b15c5b0e11a148b0543377c0ad332e710083950bca7cb3d49e70e
4
+ data.tar.gz: 6722c74ed13eabcdb3a4a7ca81cd12b9d3f286f11d00e73de759861db198f2a2
5
5
  SHA512:
6
- metadata.gz: 431921d63b8757216df9179dfd5d792103777dbf597d52cfafeb2e593ee8ab52ce12f374499826b0eba45a164bfde0f4adaa3aa3ba9ee811c6d9f44ed2ccdb7d
7
- data.tar.gz: 2e1d3bf4455fd627696c7ff7a500e6424497df012939487d39896b8e50dad421c8acd8b427f10fc3de6a51b799ca5b1532cda5508485440e4f633a5ac5677a1d
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
- - Vendored **zstd** is pinned to **1.5.2** in the current release line.
63
- - This restores reliable `MultiCompress::Zstd.train_dictionary(...)` behavior on tested platforms, including arm64-darwin.
64
- - Newer vendored zstd versions are temporarily avoided until the dictionary training regression is understood and fixed upstream.
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.2**). Brotli dictionaries can be used, but this gem does not expose Brotli training through `train_dictionary`.
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.2"
680
+ MultiCompress.version(:zstd) # => "1.5.7"
681
681
  MultiCompress.version(:lz4) # => "1.10.0"
682
- MultiCompress.version(:brotli) # => "1.1.0"
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.2**
10
+ - **zstd 1.5.7**
11
11
  - **lz4 1.10.0**
12
- - **brotli 1.1.0**
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
- > **📝 Note on v0.2.0**: Performance numbers below are from the v0.2.0 build with fiber-friendly paths enabled. There is no throughput regression compared to v0.1.2 the fiber-friendly path is only taken when a `Fiber::Scheduler` is active, and even then the worker-thread overhead is negligible for payloads large enough to benefit.
92
-
93
- Performance comparison against Ruby's built-in zlib compression (200 iterations per test):
94
-
95
- ### 🗜️ COMPRESSION RATIO (%, lower is better)
96
- ```
97
- ┌─────────────────────────────┬─────────┬─────────┬─────────┬─────────┐
98
- │ Configuration │ zlib │ lz4 │ zstd │ brotli │
99
- ├─────────────────────────────┼─────────┼─────────┼─────────┼─────────┤
100
- │ Small JSON (~10KB, GC) │ 9.4% │ 16.1% │ 6.9% │ 6.1% │
101
- Small text (~10KB, GC) │ 3.1% │ 4.6% │ 3.2% │ 2.6%
102
- Small JSON (~10KB, no GC) │ 9.4% │ 16.1% │ 6.9% 6.1%
103
- Small text (~10KB, no GC) │ 3.1% │ 4.6% │ 3.2% │ 2.6%
104
- Medium JSON (~370KB, GC) │ 8.5% │ 15.7% │ 6.7% │ 5.5%
105
- Medium logs (~168KB, GC)8.6% │ 17.2% │ 5.4% │ 3.2%
106
- Medium JSON (~370KB, no GC) 8.5% │ 15.7% │ 6.7% │ 5.5%
107
- Medium logs (~168KB, no GC) 8.6% │ 17.2% │ 5.4% │ 3.2%
108
- Large JSON (~1.6MB, GC)8.1% │ 15.1% │ 6.1% │ 5.6%
109
- Large logs (~600KB, GC) │ 7.6% │ 16.0% │ 2.9% │ 2.0%
110
- Large JSON (~1.6MB, no GC) │ 8.1% │ 15.1% │ 6.1% │ 5.6%
111
- Large logs (~600KB, no GC) │ 7.6% │ 16.0% │ 2.9% │ 2.0%
112
- └─────────────────────────────┴─────────┴─────────┴─────────┴─────────┘
113
- ```
114
-
115
- ### ⚡ TOTAL TIME (compress + decompress, ms — lower is faster)
116
- ```
117
- ┌─────────────────────────────┬─────────┬─────────┬─────────┬─────────┐
118
- Configuration │ zlib │ lz4 │ zstd │ brotli │
119
- ├─────────────────────────────┼─────────┼─────────┼─────────┼─────────┤
120
- Small JSON (~10KB, GC)0.05 0.01 0.02 0.12
121
- Small text (~10KB, GC)0.03 0.00 0.01 0.09
122
- Small JSON (~10KB, no GC) │ 0.06 0.01 0.02 │ 0.13
123
- Small text (~10KB, no GC) │ 0.03 0.00 0.01 0.11
124
- Medium JSON (~370KB, GC)2.62 0.28 0.39 2.31
125
- Medium logs (~168KB, GC)1.23 0.13 0.18 │ 0.88
126
- Medium JSON (~370KB, no GC) │ 2.65 │ 0.27 │ 0.40 │ 2.31
127
- Medium logs (~168KB, no GC) │ 1.27 0.13 0.18 │ 0.95
128
- Large JSON (~1.6MB, GC)11.70 1.36 1.93 │ 11.95
129
- Large logs (~600KB, GC)4.10 0.45 0.45 2.62
130
- │ Large JSON (~1.6MB, no GC) │ 11.47 │ 1.27 │ 1.88 │ 11.47 │
131
- Large logs (~600KB, no GC) │ 4.06 │ 0.41 │ 0.45 │ 2.79
132
- └─────────────────────────────┴─────────┴─────────┴─────────┴─────────┘
133
- ```
134
-
135
- ### 📊 SPEEDUP vs ZLIB (higher is better)
136
- ```
137
- ┌─────────────────────────────┬─────────┬─────────┬─────────┬─────────┐
138
- Configuration │ zlib │ lz4 │ zstd │ brotli │
139
- ├─────────────────────────────┼─────────┼─────────┼─────────┼─────────┤
140
- Small JSON (~10KB, GC)1.00x │ 5.00x │ 2.50x │ 0.42x
141
- Small text (~10KB, GC)1.00x │ N/A │ 3.00x │ 0.33x
142
- Small JSON (~10KB, no GC)1.00x │ 6.00x │ 3.00x │ 0.46x
143
- Small text (~10KB, no GC)1.00x │ N/A │ 3.00x │ 0.27x
144
- Medium JSON (~370KB, GC)1.00x │ 9.36x │ 6.72x 1.13x
145
- Medium logs (~168KB, GC)1.00x 9.46x 6.83x 1.40x
146
- Medium JSON (~370KB, no GC) 1.00x 9.81x │ 6.62x 1.15x
147
- │ Medium logs (~168KB, no GC) │ 1.00x │ 9.77x │ 7.06x │ 1.34x │
148
- Large JSON (~1.6MB, GC) │ 1.00x │ 8.60x │ 6.06x │ 0.98x │
149
- │ Large logs (~600KB, GC) │ 1.00x │ 9.11x │ 9.11x │ 1.56x │
150
- Large JSON (~1.6MB, no GC) │ 1.00x │ 9.03x │ 6.10x │ 1.00x
151
- │ Large logs (~600KB, no GC) │ 1.00x │ 9.90x │ 9.02x │ 1.46x │
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
@@ -0,0 +1,3 @@
1
+ // Wrapper for Brotli 1.2.0 vendored builds.
2
+
3
+ #include "vendor/brotli/c/dec/static_init.c"
@@ -0,0 +1,3 @@
1
+ // Wrapper for Brotli 1.2.0 vendored builds.
2
+
3
+ #include "vendor/brotli/c/enc/static_init.c"
@@ -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
- zstd_srcs + lz4_srcs + brotli_srcs
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.2
1
+ zstd=1.5.7
2
2
  lz4=1.10.0
3
- brotli=1.1.0
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 BrotliPrefixCodeRange
10
- _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}};
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 BrotliPrefixCodeRange
199
- _kBrotliPrefixCodeRanges[BROTLI_NUM_BLOCK_LEN_SYMBOLS];
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 <brotli/types.h>
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,
@@ -88,8 +88,7 @@
88
88
  #ifndef BROTLI_COMMON_CONTEXT_H_
89
89
  #define BROTLI_COMMON_CONTEXT_H_
90
90
 
91
- #include <brotli/port.h>
92
- #include <brotli/types.h>
91
+ #include "platform.h"
93
92
 
94
93
  typedef enum ContextType {
95
94
  CONTEXT_LSB6 = 0,