Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
flate: Improve speed in big stateless blocks. (#718)
* flate: Improve speed in big stateless blocks. Don't re-alloc and copy dict for every block when compressing more than 32KB. ``` benchmark old ns/op new ns/op delta BenchmarkEncodeDigitsSL1e4-32 52954 52850 -0.20% BenchmarkEncodeDigitsSL1e5-32 781061 745420 -4.56% BenchmarkEncodeDigitsSL1e6-32 8143640 7715674 -5.26% BenchmarkEncodeTwainSL1e4-32 68150 68415 +0.39% BenchmarkEncodeTwainSL1e5-32 715140 687326 -3.89% BenchmarkEncodeTwainSL1e6-32 7718175 7339694 -4.90% benchmark old MB/s new MB/s speedup BenchmarkEncodeDigitsSL1e4-32 188.84 189.21 1.00x BenchmarkEncodeDigitsSL1e5-32 128.03 134.15 1.05x BenchmarkEncodeDigitsSL1e6-32 122.80 129.61 1.06x BenchmarkEncodeTwainSL1e4-32 146.74 146.17 1.00x BenchmarkEncodeTwainSL1e5-32 139.83 145.49 1.04x BenchmarkEncodeTwainSL1e6-32 129.56 136.25 1.05x benchmark old allocs new allocs delta BenchmarkEncodeDigitsSL1e4-32 0 0 +0.00% BenchmarkEncodeDigitsSL1e5-32 3 0 -100.00% BenchmarkEncodeDigitsSL1e6-32 41 0 -100.00% BenchmarkEncodeTwainSL1e4-32 0 0 +0.00% BenchmarkEncodeTwainSL1e5-32 3 0 -100.00% BenchmarkEncodeTwainSL1e6-32 41 0 -100.00% benchmark old bytes new bytes delta BenchmarkEncodeDigitsSL1e4-32 0 0 +0.00% BenchmarkEncodeDigitsSL1e5-32 92929 9 -99.99% BenchmarkEncodeDigitsSL1e6-32 1298964 97 -99.99% BenchmarkEncodeTwainSL1e4-32 0 0 +0.00% BenchmarkEncodeTwainSL1e5-32 92928 8 -99.99% BenchmarkEncodeTwainSL1e6-32 1298871 92 -99.99% ``` * Pin garble to v0.7.2
- Loading branch information