]> git.ipfire.org Git - thirdparty/samba.git/commit
lib/compression/lzxpress: fix our slow compression
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Thu, 24 Nov 2022 23:46:08 +0000 (12:46 +1300)
committerJoseph Sutton <jsutton@samba.org>
Fri, 2 Dec 2022 00:00:04 +0000 (00:00 +0000)
commitd9c192546faca3b4b692738249f552b78e72d83a
treee09e561a7f0a1f3f586c882785f1f2785d778e19
parentcaa643e36e671be9cb446afc99dfae3003aa8c6e
lib/compression/lzxpress: fix our slow compression

This uses the same hash table method as lzxpress_huffman, though the
code can't be directly reused as the sizes of the offsets is
different, and there is not a block processing step here.

This will worsen the compression ratio compared to the exhaustive
search we previously used, though we still perform better than
Windows. To put numbers on it, the test files used to compress to 0.91
of Windows' compression size, and now they compress to 0.96.

On the other hand this is many orders of magnitude faster. It is
difficult to say exactly how much faster -- while the testsuite time
has only improved 200-fold (from 7 minutes to 2 seconds), most of the
remaining 2 seconds is used in data generation and management, not
compression. OSSFuzz consistently finds new vectors that time out
after a minute; on these we'll see nearly an order of magnitude of
orders of magnitude inprovement.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Autobuild-User(master): Joseph Sutton <jsutton@samba.org>
Autobuild-Date(master): Fri Dec  2 00:00:04 UTC 2022 on sn-devel-184
lib/compression/lzxpress.c