]> xenbits.xensource.com Git - xen.git/commit
lz4: pull out constant tables
authorRasmus Villemoes <linux@rasmusvillemoes.dk>
Mon, 9 Dec 2019 13:01:56 +0000 (14:01 +0100)
committerJan Beulich <jbeulich@suse.com>
Mon, 9 Dec 2019 13:01:56 +0000 (14:01 +0100)
commitfef4eb01bc53f0d44dff44579b7a6bbc31d3ff5d
tree371ec08791058f16e4c0eb33463f51bbf1ba74bf
parent2d7572cdfa4d481c1ca246aa1ce5239ccae7eb59
lz4: pull out constant tables

There's no reason to allocate the dec{32,64}table on the stack; it
just wastes a bunch of instructions setting them up and, of course,
also consumes quite a bit of stack. Using size_t for such small
integers is a little excessive.

$ scripts/bloat-o-meter /tmp/built-in.o lib/built-in.o
add/remove: 2/2 grow/shrink: 2/0 up/down: 1304/-1548 (-244)
function                                     old     new   delta
lz4_decompress_unknownoutputsize              55     718    +663
lz4_decompress                                55     632    +577
dec64table                                     -      32     +32
dec32table                                     -      32     +32
lz4_uncompress                               747       -    -747
lz4_uncompress_unknownoutputsize             801       -    -801

The now inlined lz4_uncompress functions used to have a stack
footprint of 176 bytes (according to -fstack-usage); their inlinees
have increased their stack use from 32 bytes to 48 and 80 bytes,
respectively.

Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
[Linux commit bea2b592fd18eb8ffa3fc4ad380610632d03a38f]

Use {,u}int8_t instead of plain "int" for the tables.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/common/lz4/decompress.c