martinberlin / brotli

Brotli compression format forked to work in ESP32
https://fasani.de
MIT License
24 stars 1 forks source link

brotli compression #4

Open ozanoner opened 2 years ago

ozanoner commented 2 years ago

https://github.com/martinberlin/brotli/blob/6fa4cce304e98592418f5d776632ac10065efb36/tests/src/main.cpp#L122

Hi Martin, have you managed to run brotli compression? My app on ESP32 just crashes. I see that this project is quite old. I hope you can remember how it went. Many thanks.

ozanoner commented 2 years ago

Sorry, I just saw the other open issues here. Seems that it is successful, but did you have a chance to test it with a bigger chunk of data? I tried to compress 32KB data, but it is crashing with that size.

martinberlin commented 2 years ago

Sorry no idea. It’s hard to help you like this without any detailed error report, check how much free Heap you have. Try to compress a smaller file before. Also check the buffer size. If the size is 30 Kb of course you won’t be able to decompress a 32 Kb file. If that does not work just use miniz

ozanoner commented 2 years ago

I worked on not files but in-mem buffers. The latest buffer size was 4K but still no avail. Do you know if brotli lib uses dynamic mem? I checked with grep but nothing returned for alloc. And have you checked what is the mem footprint of internal structures? Can you refer to any info resource about this? Many thanks

martinberlin commented 2 years ago

No idea, try to dump freeHeap and see how much you have. Make sure the decompress buffer is big enough to hold the decompressed data. My tests worked using compression ratio 1, higher than that and it crashed. This was experimental that’s why I recommend miniz