atomicobject / heatshrink

data compression library for embedded/real-time systems
ISC License
1.31k stars 176 forks source link

Improve perf in the push_bits() and get_bits() functions #79

Closed jcdubois closed 10 months ago

jcdubois commented 10 months ago

Also remove some compilation warnings.

With these patches, on my old core m5, I can double the compression performance (at least on some big files).

silentbicycle commented 10 months ago

Thanks. I'm really busy at the moment but will look this over more closely within the next few weeks.

jcdubois commented 10 months ago

I also added a possible perf improvement for get_bits() in the decoder.

jcdubois commented 10 months ago

One thing that is a bit surprising is that get_bits is never called with a "count" > 8. The comment in the function states that it could be called with count up to 15. But when running "make test" or "make bench" this (a count between 9 and 15) is never triggered. Is there an explanation?

silentbicycle commented 10 months ago

Could you re-target this to the develop branch? master should really be named release, I do versioned releases merging from develop. It's mentioned right at the top of CONTRIBUTING.md.

jcdubois commented 10 months ago

I have already done it in pull request #80.

jcdubois commented 10 months ago

This sound like a mess. I am going to make something cleaner.