Add decode_huffman_fast.

It's not fast yet, and the immediate impact is indeed a significant
performance loss, but follow-up commits should make it faster.

name                           old speed      new speed      delta

puffs_adler32_10k/clang        2.41GB/s ± 0%  2.40GB/s ± 1%     ~     (p=0.222 n=5+5)
puffs_adler32_100k/clang       2.41GB/s ± 1%  2.39GB/s ± 1%   -0.97%  (p=0.016 n=5+5)
puffs_flate_decode_1k/clang     116MB/s ± 5%   115MB/s ± 0%     ~     (p=0.310 n=5+5)
puffs_flate_decode_10k/clang    145MB/s ± 0%   139MB/s ± 0%   -4.18%  (p=0.016 n=4+5)
puffs_flate_decode_100k/clang   164MB/s ± 5%   158MB/s ± 1%     ~     (p=0.151 n=5+5)
puffs_zlib_decode_10k/clang     135MB/s ± 2%   131MB/s ± 0%   -2.84%  (p=0.008 n=5+5)
puffs_zlib_decode_100k/clang    154MB/s ± 1%   148MB/s ± 2%   -4.09%  (p=0.016 n=4+5)

puffs_adler32_10k/gcc          3.13GB/s ± 4%  3.19GB/s ± 0%   +1.94%  (p=0.032 n=5+5)
puffs_adler32_100k/gcc         3.14GB/s ± 3%  3.20GB/s ± 3%     ~     (p=0.056 n=5+5)
puffs_flate_decode_1k/gcc       122MB/s ± 1%    94MB/s ± 1%  -22.84%  (p=0.008 n=5+5)
puffs_flate_decode_10k/gcc      143MB/s ± 0%   110MB/s ± 0%  -23.24%  (p=0.008 n=5+5)
puffs_flate_decode_100k/gcc     158MB/s ± 0%   118MB/s ± 0%  -24.98%  (p=0.008 n=5+5)
puffs_zlib_decode_10k/gcc       136MB/s ± 0%   119MB/s ± 1%  -12.63%  (p=0.008 n=5+5)
puffs_zlib_decode_100k/gcc      150MB/s ± 1%   124MB/s ± 2%  -17.17%  (p=0.008 n=5+5)
This commit is contained in:
Nigel Tao committed 2017-11-04 14:45:11 +11:00
1 parent c550ad9bda
commit aa1f0078db
8 files changed
+753 -2

No files matched your search

+1 -1
View File
@@ -725,7 +725,7 @@ func (q *checker) bcheckExprOther(n *a.Expr, depth uint32) (*big.Int, *big.Int,
isThisMethod(q.tm, n, "decode_header", 1) || isThisMethod(q.tm, n, "decode_lsd", 1) ||
isThisMethod(q.tm, n, "decode_extension", 1) || isThisMethod(q.tm, n, "decode_id", 2) ||
isThisMethod(q.tm, n, "decode_uncompressed", 2) || isThisMethod(q.tm, n, "decode_blocks", 2) ||
isThisMethod(q.tm, n, "decode_huffman_slow", 2) ||
isThisMethod(q.tm, n, "decode_huffman_slow", 2) || isThisMethod(q.tm, n, "decode_huffman_fast", 2) ||
isThisMethod(q.tm, n, "init_fixed_huffman", 0) || isThisMethod(q.tm, n, "init_dynamic_huffman", 1) ||
isThisMethod(q.tm, n, "init_huff", 4) ||
isThatMethod(q.tm, n, t.KeyMark, 0) || isThatMethod(q.tm, n, t.KeyLimit, 1) ||
+1 -1
View File
@@ -419,7 +419,7 @@ func (q *checker) tcheckExprOther(n *a.Expr, depth uint32) error {
isThisMethod(q.tm, n, "decode_header", 1) || isThisMethod(q.tm, n, "decode_lsd", 1) ||
isThisMethod(q.tm, n, "decode_extension", 1) || isThisMethod(q.tm, n, "decode_id", 2) ||
isThisMethod(q.tm, n, "decode_uncompressed", 2) || isThisMethod(q.tm, n, "decode_blocks", 2) ||
isThisMethod(q.tm, n, "decode_huffman_slow", 2) ||
isThisMethod(q.tm, n, "decode_huffman_slow", 2) || isThisMethod(q.tm, n, "decode_huffman_fast", 2) ||
isThisMethod(q.tm, n, "init_fixed_huffman", 0) || isThisMethod(q.tm, n, "init_dynamic_huffman", 1) ||
isThisMethod(q.tm, n, "init_huff", 4) ||
isThatMethod(q.tm, n, t.KeyMark, 0) || isThatMethod(q.tm, n, t.KeyLimit, 1) ||