FAST_DEC_LOOP: only did offset check in specific condition.
authorChenxi Mao <chenxi.mao@sony.com>
Fri, 31 May 2019 00:36:13 +0000 (08:36 +0800)
committerChenxi Mao <chenxi.mao@sony.com>
Fri, 31 May 2019 00:36:13 +0000 (08:36 +0800)
commit64b5917736396754a8f93c2913f5276361831b39
tree4833cf4f8b683ec32102067952d5b728ffac7541
parentb77c9c062dcffedd25ccc18a8b59330a270c8677
FAST_DEC_LOOP: only did offset check in specific condition.

When I did FAST_DEC_LOOP performance test, I found the
offset check is much more than v1.8.3

You will see the condition check difference via lzbench with dickens test case.
v1.8.3 34959
v.1.9.x 1055885

After investigate the code, we could see the difference.
v.1.8.3 SKIP the condition check if
if condition is true in:
https://github.com/lz4/lz4/blob/v1.8.3/lib/lz4.c#L1463
AND below condition is true
https://github.com/lz4/lz4/blob/v1.8.3/lib/lz4.c#L1478\
The offset check should be invoked.

v1.9.3
The offset check code will be invoked in every loop which lead to downgrade.
So the fix would be move this check to specific condition
to avoid useless condition check.

After this change, the call number is same as v1.8.3
lib/lz4.c