Skip to content
Commit 90e67ba3 authored by Adenilson Cavalcanti's avatar Adenilson Cavalcanti Committed by Copybara-Service
Browse files

[zlib] Unconditional refill for literals with fastpath

This change refills the bit-buffer unconditionally at the start of
each iteration, and will decode up to two literals if they are in
the root table before proceeding with regular decoding.

Therefore, it requires an update on the entry requirements of inflate_fast_chunk i.e. we have two extra writes to the output
buffer in the same iteration (258 bytes + 2 bytes = 260 bytes).

Aside a few corner cases (e.g. JPG and PDF), it was a net gain for all
other inputs. In some cases up to impressive +46.3% for HTML4 in the
snappy data corpus on Icelake processors.

Observed decompression average gains were: Raptor Lake
(p-core: +11.3%, e-core: +6.6%), Cascade Lake (+13.1%),
Icelake (+16%), Sapphire Rapids (+11.9%) and M1 (+4.3%).

Second patch based on Dougall Johnson's research
(https://dougallj.wordpress.com/2022/08/20/).

Bug: 1354990
Change-Id: I8e88cef05964bc46134adf3e72e12c081dc1e2db
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4247146


Reviewed-by: default avatarChris Blume <cblume@chromium.org>
Reviewed-by: default avatarHans Wennborg <hans@chromium.org>
Commit-Queue: Adenilson Cavalcanti <cavalcantii@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1110499}
NOKEYCHECK=True
GitOrigin-RevId: 3411d3d734c01ac995a34ff8f11ca8b71d9ccd09
parent ab0d4703
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment