News for hackers. Stuff that matters.

tandemstrong

Well, it will use much less than that. The real "memory cost" of decompression will be : + compressed size

and that's it. Decompression doesn't use any memory, only the I/O buffers.

On the compression side, the memory cost is : + buffer for compression (typically == size of data to compress) + 16 KB for tables

And that's it.

We are very very far from the 12 MB mentioned.

This benchmark is a fairly bad reference.

It measures memory usage from the lz4 command line utility, without mentioning it. This is completely different from lz4 algorithm.

Effectively, it measures input / output buffers, which are external to lz4. Plus it uses highest settings for such buffers, also without mentioning it. Using -B4 setting, for example, would reduce I/O buffer memory by a 50X factor.

lz4 itself uses only 16KB for compression.

Re:Zstandard – Fast and efficient compression algorithm on Sunday January 25, 2015 @05:49AM (#8942614)
LZ4 can do that.

There is a function, called LZ4_decompress_safe_usingDict() which seems to match your objectives.

In case of doubt, you should ask directly the author, at : https://groups.google.com/forum/#!forum/lz4c

Re:A Gentle Introduction to Data Compression on Tuesday December 30, 2014 @09:57PM (#8818055)
The performance figures displayed on those pages look exceptional. Has anyone experimented with it already ?