Gopher Robot submitted the change![Open in Gerrit]()
Change information
Commit message:
compress/flate: use separate tables in histogramSplit
histogramSplit walked four quarters of the input in parallel, but
incremented counters in a single shared table. Whenever two of the
streams hit the same byte value, the increments were serialized through
store-to-load forwarding, which is common for text. Give each stream
its own table and sum them at the end.
This only affects Huffman-only encoding and blocks without matches.
goos: darwin
goarch: arm64
pkg: compress/flate
cpu: Apple M1 Max
│ old.txt │ new.txt │
│ sec/op │ sec/op vs base │
Encode/Digits/Huffman/1e5-10 125.7µ ± 2% 113.6µ ± 1% -9.58% (p=0.002 n=6)
Encode/Digits/Huffman/1e6-10 1.244m ± 1% 1.122m ± 1% -9.82% (p=0.002 n=6)
Encode/Digits/Speed/1e5-10 475.7µ ± 1% 487.6µ ± 0% +2.50% (p=0.002 n=6)
Encode/Digits/Speed/1e6-10 6.124m ± 1% 6.137m ± 1% ~ (p=0.240 n=6)
Encode/Digits/Default/1e5-10 1.108m ± 5% 1.116m ± 1% ~ (p=0.310 n=6)
Encode/Digits/Default/1e6-10 11.42m ± 2% 11.44m ± 1% ~ (p=0.937 n=6)
Encode/Digits/Compression/1e5-10 4.102m ± 6% 4.104m ± 1% ~ (p=0.818 n=6)
Encode/Digits/Compression/1e6-10 45.95m ± 4% 45.93m ± 1% ~ (p=0.937 n=6)
Encode/Newton/Huffman/1e5-10 144.0µ ± 4% 133.4µ ± 2% -7.39% (p=0.002 n=6)
Encode/Newton/Huffman/1e6-10 1.641m ± 2% 1.522m ± 1% -7.28% (p=0.002 n=6)
Encode/Newton/Speed/1e5-10 410.7µ ± 11% 410.5µ ± 1% ~ (p=0.818 n=6)
Encode/Newton/Speed/1e6-10 4.595m ± 3% 4.589m ± 1% ~ (p=0.240 n=6)
Encode/Newton/Default/1e5-10 754.6µ ± 3% 755.2µ ± 2% ~ (p=0.589 n=6)
Encode/Newton/Default/1e6-10 7.984m ± 2% 7.984m ± 2% ~ (p=0.937 n=6)
Encode/Newton/Compression/1e5-10 4.731m ± 1% 4.737m ± 1% ~ (p=0.699 n=6)
Encode/Newton/Compression/1e6-10 51.85m ± 1% 51.63m ± 2% ~ (p=0.485 n=6)
geomean 2.322m 2.276m -2.00%
│ old.txt │ new.txt │
│ B/s │ B/s vs base │
Encode/Digits/Huffman/1e5-10 758.8Mi ± 2% 839.2Mi ± 1% +10.60% (p=0.002 n=6)
Encode/Digits/Huffman/1e6-10 766.7Mi ± 1% 850.2Mi ± 1% +10.89% (p=0.002 n=6)
Encode/Digits/Speed/1e5-10 200.5Mi ± 1% 195.6Mi ± 0% -2.44% (p=0.002 n=6)
Encode/Digits/Speed/1e6-10 155.7Mi ± 1% 155.4Mi ± 1% ~ (p=0.240 n=6)
Encode/Digits/Default/1e5-10 86.07Mi ± 4% 85.45Mi ± 1% ~ (p=0.310 n=6)
Encode/Digits/Default/1e6-10 83.52Mi ± 2% 83.33Mi ± 1% ~ (p=0.937 n=6)
Encode/Digits/Compression/1e5-10 23.25Mi ± 6% 23.24Mi ± 1% ~ (p=0.848 n=6)
Encode/Digits/Compression/1e6-10 20.76Mi ± 4% 20.76Mi ± 1% ~ (p=0.851 n=6)
Encode/Newton/Huffman/1e5-10 662.1Mi ± 4% 715.0Mi ± 2% +7.98% (p=0.002 n=6)
Encode/Newton/Huffman/1e6-10 581.2Mi ± 2% 626.8Mi ± 1% +7.85% (p=0.002 n=6)
Encode/Newton/Speed/1e5-10 232.2Mi ± 10% 232.3Mi ± 1% ~ (p=0.818 n=6)
Encode/Newton/Speed/1e6-10 207.5Mi ± 3% 207.8Mi ± 1% ~ (p=0.240 n=6)
Encode/Newton/Default/1e5-10 126.4Mi ± 3% 126.3Mi ± 2% ~ (p=0.589 n=6)
Encode/Newton/Default/1e6-10 119.5Mi ± 2% 119.4Mi ± 2% ~ (p=0.853 n=6)
Encode/Newton/Compression/1e5-10 20.16Mi ± 1% 20.13Mi ± 1% ~ (p=0.727 n=6)
Encode/Newton/Compression/1e6-10 18.39Mi ± 1% 18.47Mi ± 2% ~ (p=0.509 n=6)
geomean 129.9Mi 132.5Mi +2.05%
Updates #81398
Change-Id: I0eb35c94d7397651350d542f3f8a3d5de1c70682
Files:
- M src/compress/flate/huffman_code.go
Change size: S
Delta: 1 file changed, 13 insertions(+), 12 deletions(-)
Branch: refs/heads/master
Open in Gerrit
Gerrit-MessageType: merged
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I0eb35c94d7397651350d542f3f8a3d5de1c70682
Gerrit-Change-Number: 829566
Gerrit-PatchSet: 3