ulikunitz / xz

Pure golang package for reading and writing xz-compressed files
Other
477 stars 45 forks source link

Change lit type #33

Closed frrad closed 3 years ago

frrad commented 4 years ago

This PR changes type lit to be byte instead of a struct containing a byte. This improves performance slightly at least on my workload.

before:
BenchmarkBlocksFromMemory-4           27          60508126 ns/op

after: 
BenchmarkBlocksFromMemory-4           28          54614319 ns/op

Before: Screenshot 2020-04-18 at 4 21 53 PM notice how much time decodeLiteral spends calling runtime.convT2Inoptr

After: Screenshot 2020-04-18 at 4 21 20 PM that call is eliminated