Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf: upgrade compress package test and benchmark. (#2009)
Rebased #1880 to the current main. Benchmarking in progress. `benchstat` comparison of all benchmarks with and without the upgraded compress package.: ``` goos: linux goarch: amd64 pkg: github.com/dgraph-io/badger/v4 cpu: AMD Ryzen 7 6800H with Radeon Graphics │ without_s2.txt │ with_s2.txt │ │ sec/op │ sec/op vs base │ DbGrowth-16 3.486 ± ∞ ¹ 3.829 ± ∞ ¹ ~ (p=1.000 n=1) ² IteratePrefixSingleKey/Key_lookups-16 59.02µ ± 3% 58.56µ ± 2% ~ (p=0.240 n=6) ReadWrite/0.1,0064-16 1.545µ ± 6% 1.477µ ± 17% ~ (p=0.394 n=6) ReadWrite/0.2,0064-16 1.617µ ± 11% 1.471µ ± 6% ~ (p=0.065 n=6) ReadWrite/0.5,0064-16 1.433µ ± 5% 1.422µ ± 3% ~ (p=0.394 n=6) ReadWrite/1.0,0064-16 1.255µ ± 21% 1.276µ ± 7% ~ (p=0.818 n=6) ReadWrite/0.1,0128-16 1.732µ ± 12% 1.684µ ± 4% ~ (p=0.394 n=6) ReadWrite/0.2,0128-16 1.657µ ± 18% 1.637µ ± 5% ~ (p=0.509 n=6) ReadWrite/0.5,0128-16 1.544µ ± 6% 1.595µ ± 2% ~ (p=0.180 n=6) ReadWrite/1.0,0128-16 1.471µ ± 9% 1.580µ ± 22% +7.41% (p=0.026 n=6) ReadWrite/0.1,0256-16 1.861µ ± 4% 1.897µ ± 12% +1.96% (p=0.009 n=6) ReadWrite/0.2,0256-16 1.884µ ± 9% 2.038µ ± 9% ~ (p=0.132 n=6) ReadWrite/0.5,0256-16 1.989µ ± 16% 1.944µ ± 18% ~ (p=0.818 n=6) ReadWrite/1.0,0256-16 1.847µ ± 6% 2.040µ ± 23% +10.45% (p=0.002 n=6) ReadWrite/0.1,0512-16 2.292µ ± 5% 2.483µ ± 13% ~ (p=0.132 n=6) ReadWrite/0.2,0512-16 2.272µ ± 5% 2.500µ ± 20% +10.06% (p=0.009 n=6) ReadWrite/0.5,0512-16 2.427µ ± 8% 2.787µ ± 14% +14.81% (p=0.041 n=6) ReadWrite/1.0,0512-16 2.711µ ± 9% 2.914µ ± 16% +7.51% (p=0.026 n=6) ReadWrite/0.1,1024-16 3.144µ ± 3% 3.618µ ± 8% +15.09% (p=0.002 n=6) ReadWrite/0.2,1024-16 3.302µ ± 2% 3.984µ ± 9% +20.67% (p=0.002 n=6) ReadWrite/0.5,1024-16 3.659µ ± 4% 4.482µ ± 5% +22.50% (p=0.002 n=6) ReadWrite/1.0,1024-16 4.058µ ± 2% 5.020µ ± 10% +23.72% (p=0.002 n=6) ReadWrite/0.1,2048-16 5.361µ ± 51% 5.913µ ± 20% ~ (p=0.180 n=6) ReadWrite/0.2,2048-16 5.433µ ± 8% 6.210µ ± 17% +14.28% (p=0.041 n=6) ReadWrite/0.5,2048-16 5.786µ ± 4% 7.123µ ± 17% +23.10% (p=0.002 n=6) ReadWrite/1.0,2048-16 7.514µ ± 15% 8.859µ ± 14% +17.91% (p=0.009 n=6) ReadWrite/0.1,4096-16 8.634µ ± 48% 9.986µ ± 15% ~ (p=0.065 n=6) ReadWrite/0.2,4096-16 9.165µ ± 10% 10.957µ ± 9% +19.55% (p=0.009 n=6) ReadWrite/0.5,4096-16 11.59µ ± 10% 12.36µ ± 10% ~ (p=0.132 n=6) ReadWrite/1.0,4096-16 13.20µ ± 7% 16.00µ ± 12% +21.18% (p=0.004 n=6) ReadWrite/0.1,8192-16 15.19µ ± 4% 16.53µ ± 17% +8.83% (p=0.002 n=6) ReadWrite/0.2,8192-16 17.01µ ± 29% 20.09µ ± 15% ~ (p=0.065 n=6) ReadWrite/0.5,8192-16 20.85µ ± 9% 23.59µ ± 12% +13.13% (p=0.041 n=6) ReadWrite/1.0,8192-16 30.35µ ± 11% 31.33µ ± 18% ~ (p=0.937 n=6) ReadWrite/0.1,16384-16 35.34µ ± 8% 33.31µ ± 13% ~ (p=0.180 n=6) ReadWrite/0.2,16384-16 40.23µ ± 6% 36.56µ ± 16% ~ (p=0.180 n=6) ReadWrite/0.5,16384-16 52.58µ ± 7% 42.01µ ± 6% -20.11% (p=0.002 n=6) ReadWrite/1.0,16384-16 176.05µ ± 59% 56.74µ ± 11% -67.77% (p=0.002 n=6) geomean 7.909µ 8.207µ +3.76% ¹ need >= 6 samples for confidence interval at level 0.95 ² need >= 4 samples to detect a difference at alpha level 0.05 pkg: github.com/dgraph-io/badger/v4/skl │ without_s2.txt │ with_s2.txt │ │ sec/op │ sec/op vs base │ ReadWrite/frac_0-16 310.4n ± 2% 306.6n ± 3% ~ (p=0.132 n=6) ReadWrite/frac_1-16 289.9n ± 4% 287.9n ± 8% ~ (p=0.509 n=6) ReadWrite/frac_2-16 273.0n ± 3% 273.1n ± 2% ~ (p=0.818 n=6) ReadWrite/frac_3-16 256.1n ± 1% 257.8n ± 1% ~ (p=0.288 n=6) ReadWrite/frac_4-16 239.8n ± 2% 242.2n ± 12% ~ (p=0.329 n=6) ReadWrite/frac_5-16 218.7n ± 4% 232.5n ± 5% +6.33% (p=0.045 n=6) ReadWrite/frac_6-16 200.7n ± 1% 220.3n ± 9% +9.77% (p=0.032 n=6) ReadWrite/frac_7-16 176.5n ± 3% 184.6n ± 8% ~ (p=0.310 n=6) ReadWrite/frac_8-16 154.6n ± 5% 154.8n ± 8% ~ (p=0.623 n=6) ReadWrite/frac_9-16 120.1n ± 5% 117.5n ± 8% ~ (p=0.589 n=6) geomean 215.6n 219.4n +1.78% pkg: github.com/dgraph-io/badger/v4/table │ without_s2.txt │ with_s2.txt │ │ sec/op │ sec/op vs base │ Builder/no_compression-16 136.2m ± 6% 137.7m ± 5% ~ (p=0.699 n=6) Builder/encryption-16 183.9m ± 9% 180.9m ± 4% ~ (p=0.394 n=6) Builder/zstd_compression/level_1-16 173.2m ± 2% 172.0m ± 3% ~ (p=0.699 n=6) Builder/zstd_compression/level_3-16 172.1m ± 5% 171.4m ± 4% ~ (p=0.699 n=6) Builder/zstd_compression/level_15-16 171.6m ± 2% 170.4m ± 3% ~ (p=0.818 n=6) Read-16 519.8m ± 11% 403.1m ± 24% -22.45% (p=0.002 n=6) ReadAndBuild-16 1.474 ± 4% 1.353 ± 5% -8.21% (p=0.002 n=6) ReadMerged-16 851.5m ± 3% 721.2m ± 6% -15.31% (p=0.002 n=6) Checksum/CRC_1024-16 66.03n ± 5% 64.64n ± 4% ~ (p=0.310 n=6) Checksum/xxHash64_1024-16 64.70n ± 2% 64.23n ± 7% ~ (p=0.310 n=6) Checksum/SHA256_1024-16 513.0n ± 1% 522.9n ± 1% +1.94% (p=0.004 n=6) Checksum/CRC_2048-16 121.0n ± 2% 123.2n ± 2% +1.73% (p=0.045 n=6) Checksum/xxHash64_2048-16 123.6n ± 2% 124.7n ± 1% ~ (p=0.147 n=6) Checksum/SHA256_2048-16 960.4n ± 1% 970.2n ± 2% +1.03% (p=0.015 n=6) Checksum/CRC_4096-16 241.5n ± 2% 240.3n ± 4% ~ (p=0.900 n=6) Checksum/xxHash64_4096-16 244.5n ± 2% 251.9n ± 2% +3.07% (p=0.004 n=6) Checksum/SHA256_4096-16 1.864µ ± 2% 1.884µ ± 1% ~ (p=0.310 n=6) Checksum/CRC_8192-16 477.5n ± 1% 496.3n ± 4% +3.95% (p=0.026 n=6) Checksum/xxHash64_8192-16 475.7n ± 2% 486.3n ± 2% +2.25% (p=0.015 n=6) Checksum/SHA256_8192-16 3.674µ ± 1% 3.700µ ± 1% ~ (p=0.065 n=6) Checksum/CRC_16384-16 943.1n ± 3% 965.2n ± 3% ~ (p=0.093 n=6) Checksum/xxHash64_16384-16 946.1n ± 2% 954.3n ± 1% ~ (p=0.093 n=6) Checksum/SHA256_16384-16 7.260µ ± 1% 7.351µ ± 1% ~ (p=0.065 n=6) Checksum/CRC_32768-16 1.878µ ± 2% 1.877µ ± 3% ~ (p=0.970 n=6) Checksum/xxHash64_32768-16 1.870µ ± 1% 1.899µ ± 2% +1.58% (p=0.009 n=6) Checksum/SHA256_32768-16 14.74µ ± 5% 14.66µ ± 1% ~ (p=0.589 n=6) Checksum/CRC_65536-16 3.807µ ± 2% 3.785µ ± 2% ~ (p=0.333 n=6) Checksum/xxHash64_65536-16 3.943µ ± 5% 3.825µ ± 3% ~ (p=0.240 n=6) Checksum/SHA256_65536-16 29.64µ ± 1% 29.03µ ± 2% ~ (p=0.065 n=6) Checksum/CRC_131072-16 7.564µ ± 5% 7.612µ ± 3% ~ (p=0.699 n=6) Checksum/xxHash64_131072-16 7.521µ ± 3% 7.595µ ± 1% ~ (p=0.093 n=6) Checksum/SHA256_131072-16 58.56µ ± 4% 58.02µ ± 1% ~ (p=0.093 n=6) Checksum/CRC_262144-16 15.31µ ± 3% 15.06µ ± 2% -1.63% (p=0.030 n=6) Checksum/xxHash64_262144-16 16.43µ ± 6% 15.16µ ± 1% -7.77% (p=0.002 n=6) Checksum/SHA256_262144-16 120.6µ ± 1% 116.8µ ± 1% -3.16% (p=0.002 n=6) Checksum/CRC_1048576-16 62.68µ ± 13% 60.48µ ± 2% -3.50% (p=0.004 n=6) Checksum/xxHash64_1048576-16 61.77µ ± 1% 61.50µ ± 2% ~ (p=0.589 n=6) Checksum/SHA256_1048576-16 468.9µ ± 2% 471.8µ ± 1% ~ (p=0.240 n=6) RandomRead-16 20.49µ ± 8% 14.98µ ± 4% -26.90% (p=0.002 n=6) Builder/snappy_compression-16 157.2m ± 6% geomean 32.82µ 39.69µ -2.21% │ without_s2.txt │ with_s2.txt │ │ B/s │ B/s vs base │ Builder/no_compression-16 582.4Mi ± 5% 576.3Mi ± 5% ~ (p=0.699 n=6) Builder/encryption-16 431.5Mi ± 8% 438.7Mi ± 4% ~ (p=0.394 n=6) Builder/zstd_compression/level_1-16 458.2Mi ± 2% 461.4Mi ± 3% ~ (p=0.699 n=6) Builder/zstd_compression/level_3-16 461.0Mi ± 4% 463.1Mi ± 4% ~ (p=0.699 n=6) Builder/zstd_compression/level_15-16 462.3Mi ± 2% 465.5Mi ± 3% ~ (p=0.818 n=6) Builder/snappy_compression-16 504.7Mi ± 5% geomean 476.4Mi 483.0Mi +0.49% │ with_s2.txt │ │ B/op │ Builder/no_compression-16 217.5Mi ± 0% Builder/encryption-16 362.9Mi ± 0% Builder/zstd_compression/level_1-16 295.0Mi ± 0% Builder/zstd_compression/level_3-16 295.0Mi ± 0% Builder/zstd_compression/level_15-16 295.0Mi ± 0% Builder/snappy_compression-16 300.8Mi ± 0% geomean 291.2Mi │ with_s2.txt │ │ allocs/op │ Builder/no_compression-16 177.4k ± 0% Builder/encryption-16 297.3k ± 0% Builder/zstd_compression/level_1-16 177.4k ± 0% Builder/zstd_compression/level_3-16 177.4k ± 0% Builder/zstd_compression/level_15-16 177.4k ± 0% Builder/snappy_compression-16 177.4k ± 0% geomean 193.3k pkg: github.com/dgraph-io/badger/v4/y │ without_s2.txt │ with_s2.txt │ │ sec/op │ sec/op vs base │ Buffer/bytes-buffer-16 1.088µ ± 1535% 1.046µ ± 678% ~ (p=0.937 n=6) Buffer/page-buffer/page-size-1024-16 520.5n ± 1833% 560.3n ± 6% ~ (p=0.485 n=6) geomean 752.4n 765.6n +1.75%```
- Loading branch information