pierrec / lz4

LZ4 compression and decompression in pure Go
BSD 3-Clause "New" or "Revised" License
869 stars 141 forks source link

[v3] backport arm64 asm changes. #177

Closed lizthegrey closed 2 years ago

lizthegrey commented 2 years ago

backports 1cbdd8169b0510935efd9164dbbea4dcda897fb6 and e99166d96a6e0c4d9f5141d3cf9e6952ee8dc7a4 (thanks @greatroar!)

benchmark                        old ns/op     new ns/op     delta
BenchmarkCompress-16             6424327       6428552       +0.07%
BenchmarkCompressRandom-16       9229          9246          +0.18%
BenchmarkCompressHC-16           53754504      54092329      +0.63%
BenchmarkUncompress-16           16.4          17.0          +3.72%
BenchmarkUncompressPg1661-16     2617869       1797886       -31.32%
BenchmarkUncompressDigits-16     202911        144732        -28.67%
BenchmarkUncompressTwain-16      1695992       1143263       -32.59%
BenchmarkUncompressRand-16       10602         10587         -0.14%
BenchmarkSkipBytesPg1661-16      2588717       1760354       -32.00%
BenchmarkSkipBytesDigits-16      194518        136439        -29.86%
BenchmarkSkipBytesTwain-16       1672902       1110007       -33.65%
BenchmarkSkipBytesRand-16        9456          9500          +0.47%
BenchmarkCompressPg1661-16       54900         50257         -8.46%
BenchmarkCompressDigits-16       8840          8740          -1.13%
BenchmarkCompressTwain-16        34420         32441         -5.75%
BenchmarkCompressRand-16         1765          1534          -13.09%
BenchmarkWriterReset-16          9499          9557          +0.61%

benchmark                        old MB/s     new MB/s     speedup
BenchmarkCompressRandom-16       1775.21      1771.98      1.00x
BenchmarkUncompressPg1661-16     227.26       330.91       1.46x
BenchmarkUncompressDigits-16     492.84       690.95       1.40x
BenchmarkUncompressTwain-16      228.69       339.25       1.48x
BenchmarkUncompressRand-16       1545.40      1547.51      1.00x
BenchmarkSkipBytesPg1661-16      229.82       337.96       1.47x
BenchmarkSkipBytesDigits-16      514.11       732.95       1.43x
BenchmarkSkipBytesTwain-16       231.84       349.41       1.51x
BenchmarkSkipBytesRand-16        1732.64      1724.67      1.00x
BenchmarkCompressPg1661-16       10836.57     11837.75     1.09x
BenchmarkCompressDigits-16       11313.02     11442.33     1.01x
BenchmarkCompressTwain-16        11268.32     11955.73     1.06x
BenchmarkCompressRand-16         9282.08      10681.94     1.15x
lizthegrey commented 2 years ago

https://flamegraph.com/share/2ee9b0a9-d089-11ec-a9d4-8ee0130fd632 shows improvement in lz4 time, yay.

pierrec commented 2 years ago

nice one @lizthegrey !!