3 ms·
While I'm around, I've been looking for a good compressor for an embedded scenario, where compression time and memory is near-irrelevant (it's done offline), bu
by AceJohnny2 10y ago
While I'm around, I've been looking for a good compressor for an embedded scenario, where compression time and memory is near-irrelevant (it's done offline), but streaming decompression time and memory use (both in code and scratch memory) is primordial. By memory use, I'm talking a system with single-digit megabyte RAM, and decompressor scratch memory usage in the dozens of kilobytes.
Right now, we're using LZSS because the decompressor code is tiny (hundreds of bytes), and scratch memory is in the single-digit kilobytes.
Any suggestions? All benchmarks I can find online are focused on desktop usage (where comp/decomp memory use is either not mentioned or in the megabyte range) or web streaming usage (where total comp+decomp time is important. I don't care (within reason) about comp time)
- stijlist 10y agohttps://github.com/atomicobject/heatshrink https://github.com/atomicobject/heatshrink, by @silentbicycle, sounds like it might be up your alley.
- AceJohnny2 10y ago...which is based on LZSS :|
- unwind 10y agoI've had good results with LZJB[1] (designed by Jeff Bonwick for ZFS) in embedded scenarios, perhaps at least worth testing for you? I even have some public code for it, there's Python module [2] that will adequately address your wish for mediocre offline-friendly performance (heh) and a streaming C decompression library [3]. The runtime memory usage for the decompressor are tiny (which is good, since from my perspective your system sounds huge!) so that should be fine at least. Very interested in any feedback you might have, of course. [1] https://en.wikipedia.org/wiki/LZJB https://en.wikipedia.org/wiki/LZJB [2] https://github.com/unwind/python-lzjb https://github.com/unwind/python-lzjb [3] https://github.com/unwind/lzjb-stream https://github.com/unwind/lzjb-stream