journal: in some cases we have to decompress the full lz4 field
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 11 Dec 2015 14:10:33 +0000 (09:10 -0500)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sun, 13 Dec 2015 19:54:47 +0000 (14:54 -0500)
commit1f4b467daa2999ab0e4345c1f1069567852f567f
treef15a02037237dfd9313cbac7aaff3d71a259698e
parent2aaec9b4f61c1c1fa3374f40f0f1e828b6c53e1e
journal: in some cases we have to decompress the full lz4 field

lz4 has to decompress a whole "sequence" at a time. When the compressed
data is composed of a repeating pattern, the whole set of repeats has
do be docompressed, and the output buffer has to be big enough.

This is unfortunate, because potentially the slowdown is very big. We
are only interested in the field name, but we might have to decompress
the whole thing. But the full cost will be borne out only when the
full entry is a repeating pattern. In practice this shouldn't happen
(apart from tests and the like). Hopefully lz4 will be fixed to avoid
this problem, or it will grow a new function which we can use [1], so
this fix should be remporary.

[1] https://groups.google.com/d/msg/lz4c/_3kkz5N6n00/oTahzqErCgAJ
src/journal/compress.c