[zlib] Increase inflate dynamic table sizes
First patch* based on Dougall Johnson zlib research**. The basic idea is to use a bigger root table to avoid a branch misprediction while performing a lookup when the searched Huffman code is actually located in a nested sub-table. The increase of memory use in the structure inflate_state will be 1920 bytes (i.e. 1332 - 852 = 480 x sizeof(code) = 480 x 4) per active inflate context which should be fine given that even lower spec boards generally have CPUs with a L1 cache size of 32KB. Performance gains are dependent on input entropy features plus architecture, but are a net positive on both x86 (Haswell: 5.1%), Cortex big.LITTLE.Medium (X1, A55, A76) on 32bit (6.3%, 1.44%, 5.7%) and 64bit (8.3%, 2.4%, 6.7%) plus M1 (7.6%). * https://github.com/dougallj/zlib-dougallj/commits/main ** https://dougallj.wordpress.com/2022/08/20/ Bug: 1354990 Change-Id: I1f784bfaf9a8108f657e3c9753030482e5026366 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3888219 Reviewed-by:Chris Blume <cblume@chromium.org> Commit-Queue: Adenilson Cavalcanti <cavalcantii@chromium.org> Cr-Commit-Position: refs/heads/main@{#1046251} NOKEYCHECK=True GitOrigin-RevId: b40b1f7a30b58aeb0d6e4906ae25c6e4734f3b1f
Please register or sign in to comment