Remove a superfluous while loop.

It's not obvious why the adler benchmark numbers also change (for the
better), but it seems superficially repeatable for fresh before/after
measurements. I'll take it for now, but perhaps the adler benchmarks
need to run for longer.

name                           old speed      new speed      delta

puffs_adler32_10k/clang        2.38GB/s ± 2%  2.45GB/s ± 0%  +2.87%  (p=0.008 n=5+5)
puffs_adler32_100k/clang       2.39GB/s ± 1%  2.44GB/s ± 0%  +2.42%  (p=0.008 n=5+5)
puffs_flate_decode_1k/clang     129MB/s ± 2%   133MB/s ± 0%  +3.41%  (p=0.008 n=5+5)
puffs_flate_decode_10k/clang    161MB/s ± 1%   174MB/s ± 0%  +8.46%  (p=0.008 n=5+5)
puffs_flate_decode_100k/clang   187MB/s ± 3%   205MB/s ± 0%  +9.51%  (p=0.008 n=5+5)
puffs_zlib_decode_10k/clang     150MB/s ± 1%   162MB/s ± 0%  +8.09%  (p=0.008 n=5+5)
puffs_zlib_decode_100k/clang    174MB/s ± 1%   188MB/s ± 0%  +8.13%  (p=0.008 n=5+5)

puffs_adler32_10k/gcc          3.12GB/s ± 3%  3.25GB/s ± 0%  +4.30%  (p=0.016 n=5+4)
puffs_adler32_100k/gcc         3.12GB/s ± 3%  3.25GB/s ± 0%  +4.15%  (p=0.008 n=5+5)
puffs_flate_decode_1k/gcc       128MB/s ± 3%   132MB/s ± 0%  +3.11%  (p=0.008 n=5+5)
puffs_flate_decode_10k/gcc      172MB/s ± 4%   170MB/s ± 0%    ~     (p=0.151 n=5+5)
puffs_flate_decode_100k/gcc     196MB/s ± 2%   207MB/s ± 0%  +5.46%  (p=0.008 n=5+5)
puffs_zlib_decode_10k/gcc       164MB/s ± 1%   161MB/s ± 1%  -1.34%  (p=0.008 n=5+5)
puffs_zlib_decode_100k/gcc      186MB/s ± 0%   194MB/s ± 0%  +4.12%  (p=0.016 n=4+5)
This commit is contained in:
Nigel Tao committed 2017-11-05 06:57:10 +11:00
1 parent f968950345
commit fe5e9c68b3
2 files changed
+41 -64

No files matched your search

+4 -12
View File
@@ -50,18 +50,10 @@ pri func flate_decoder.decode_huffman_fast?(dst writer1, src reader1)() {
assert n_bits >= 15
// Decode an lcode symbol from H-L.
while true { // TODO: drop the while.
table_entry = this.huffs[0][bits & lmask]
table_entry_n_bits = table_entry & 0x0F
if n_bits >= table_entry_n_bits {
bits >>= table_entry_n_bits
n_bits -= table_entry_n_bits
break
}
assert n_bits < 15 via "a < b: a < c; c <= b"(c:table_entry_n_bits)
bits |= (in.src.read_u8?() as u32) << n_bits
n_bits += 8
}
table_entry = this.huffs[0][bits & lmask]
table_entry_n_bits = table_entry & 0x0F
bits >>= table_entry_n_bits
n_bits -= table_entry_n_bits
if (table_entry >> 31) != 0 {
// Literal.