Change the back-copy unroll count from 8 to 3.

We're possibly overfitting now on the very small benchmark corpus (3
files), but we can test on larger corpuses later. Algorithmically, it
does match what zlib does.

name                           old speed     new speed     delta
puffs_flate_decode_1k/clang    188MB/s ± 0%  191MB/s ± 1%   +1.55%  (p=0.008 n=5+5)
puffs_flate_decode_10k/clang   242MB/s ± 2%  277MB/s ± 1%  +14.72%  (p=0.008 n=5+5)
puffs_flate_decode_100k/clang  273MB/s ± 1%  315MB/s ± 1%  +15.63%  (p=0.008 n=5+5)
puffs_flate_decode_1k/gcc      187MB/s ± 0%  194MB/s ± 2%   +3.56%  (p=0.008 n=5+5)
puffs_flate_decode_10k/gcc     242MB/s ± 0%  279MB/s ± 1%  +15.29%  (p=0.016 n=5+4)
puffs_flate_decode_100k/gcc    288MB/s ± 1%  315MB/s ± 0%   +9.29%  (p=0.008 n=5+5)

Note that these are benchmark numbers for an 'ideal', hand-written C
implementation, not for Puffs' generated C code.
This commit is contained in:
Nigel Tao committed 2017-08-03 10:53:41 +10:00
1 parent fa89c397b0
commit 6af3852fa8
1 file changed
+1 -6
+1 -6
View File
@@ -235,12 +235,7 @@ outer_loop:
}
uint8_t* pback = pdst - distance;
for (; length >= 8; length -= 8) {
*pdst++ = *pback++;
*pdst++ = *pback++;
*pdst++ = *pback++;
*pdst++ = *pback++;
*pdst++ = *pback++;
for (; length >= 3; length -= 3) {
*pdst++ = *pback++;
*pdst++ = *pback++;
*pdst++ = *pback++;