|
|
Log in / Subscribe / Register

Consider the resources required for decompression

Consider the resources required for decompression

Posted Jan 19, 2026 1:26 UTC (Mon) by excors (subscriber, #95769)
In reply to: Consider the resources required for decompression by jreiser
Parent article: Format-specific compression with OpenZL

> If the receiving environment does not have enough RAM for working storage, or enough ROM to store the decompression program, then the compression ratio does not matter. ... Think of a 16-bit microcontroller with a total of 128kB of RAM and 256kB of ROM.

In that case (or even smaller), I've found Zlib is surprisingly good. The uzlib implementation takes about 2KB of ROM (on Cortex-M4), and about 1KB RAM + window size (max 32KB but you can probably reduce it to 16KB or 8KB without much impact on compression ratio). If you're storing compressed data in flash (e.g. when downloading a firmware update) then you want to minimise `code_size + uncompressed_size * compression_ratio`, and I suspect it's going to be hard to beat uzlib with a more sophisticated algorithm until you're getting up in the hundreds of KBs of data.

It would be nice if there were more algorithms (with size-optimised implementations) competing in that space, and benchmarks showing what's the best tradeoff in different ranges. It sounds like that's not what OpenZL is interested in though, since it's currently designed with a universal decompressor that will presumably be huge.


to post comments


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds