]> git.ipfire.org Git - thirdparty/zstd.git/commit
fix benchmark issue when measuring only decoding speed 1033/head
authorYann Collet <cyan@fb.com>
Mon, 5 Mar 2018 21:50:07 +0000 (13:50 -0800)
committerYann Collet <cyan@fb.com>
Mon, 5 Mar 2018 21:57:41 +0000 (13:57 -0800)
commit03e7e1419249bf7f0ce52244e945224497c216f7
tree6d8813bd9cceec28ee02fe9a3761198405edd700
parent99afe725768909e1eba5aca29552917f48c68407
fix benchmark issue when measuring only decoding speed

zstd bench module can focus on decompression speed _only_.
This is useful when trying to measure performance
on large input data compressed using a high level
as compression time becomes problematic (too long).

This mode is triggered by command : zstd -b -d

Problem was : in such a mode,
measured decoding speed was > 10% slower
than in nominal mode (compression + decompression),
making decompression benchmark mode much less useful.

This patch fixes the issue.
It's not completely clear why, but
moving the `memcpy()` operation sooner in the pipeline fixed it.

I can still measure some difference, but it is in the < 2% range,
so it's much more tolerable.

also : it doesn't matter anymore in which order are selected
commands `-b` and `-d`.
The combination always triggers bench_decodeOnly mode.
programs/bench.c
programs/zstdcli.c