...
Before we go further, it would be better to see the benchmark result of Zstandard. I compared the compressed size and compression time of 3 1kb-sized messages (3102 bytes in total), with the Draft-implementation of ZStandard Compression Codec and all currently available CompressionCodecs. You can see the benchmark code from this commit. All elapsed times are the average of 1000 trials.100 iterations, preceded by 5 warm up iterations. (To run the benchmark in your environment, move to jmh-benchmarks and run following command: ./jmh.sh -wi 5 -i 100 -f 1)
Codec | Level | Size (byte) | Time (ms) | Description |
---|---|---|---|---|
Gzip | - | 396153 | 0.083 ± 0.008 | |
Snappy | - | 1,06337 | 0.030 ± 0.001 | |
LZ4 | - | 38757 | 0.012 ± 0.001 | |
Zstandard | 1 | 37456 | 0.045 ± 0.003 | Speed-first setting. |
2 | 37458 | 0.039 ± 0.001 | ||
3 | 37983 | 0.057 ± 0.003 | Facebook's recommended default setting. | |
4 | 379226 | 0.121 ± 0.013 | ||
5 | 373102 | 0.081 ± 0.004 | ||
6 | 373252 | 0.135 ± 0.016 | ||
7 | 373667 | 0.688 ± 0.060 | ||
8 | 373707 | 0.805 ± 0.072 | ||
9 | 373830 | 1.038 ± 0.060 | ||
10 | 373 | 1,029.400 ± 0.099 | ||
11 | 3731,973 | 2.515 ± 0.188 | ||
12 | 3731,985 | 2.413 ± 0.195 | ||
13 | 373 | 2,352.889 ± 0.219 | ||
14 | 373 | 2,324.340 ± 0.030 | ||
15 | 374 | 1,668.943 ± 0.118 | ||
16 | 3744,996 | 6.759 ± 0.625 | ||
17 | 3712,418 | 3.045 ± 0.198 | ||
18 | 3717,434 | 8.508 ± 0.787 | ||
19 | 3689,997 | 8.721 ± 0.499 | ||
20 | 36824,701 | 29.475 ± 2.456 | ||
21 | 36890,044 | 54.713 ± 5.023 | ||
22 | 368282,768 | 227.643 ± 18.390 | Size-first setting. |
...
As you can see above, ZStandard outplays all existing algorithms shows outstanding performance in both of compression rate and speed, especially working with the speed-first setting (level 1). To the extent that only LZ4 can be compared to ZStandard.
Public Interfaces
This feature requires modification on both of Configuration Options and Binary Log format.
...