# Help optimizing simple decompressor

**URL:** <https://discourse.haskell.org/t/help-optimizing-simple-decompressor/13425>\
**Category:** Learn\
**Created:** [December 18, 2025, 1:08pm UTC](https://discourse.haskell.org/t/help-optimizing-simple-decompressor/13425 "2025-12-18T13:08:11Z")\
**Posts on this page:** 1\
**Showing post:** 17

<div class="post-metadata">

**Author:** ![jaror](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/jaror/32/3271_2.png) [@jaror](https://discourse.haskell.org/u/jaror)\
**Post date:** [December 29, 2025, 10:10am UTC](https://discourse.haskell.org/t/help-optimizing-simple-decompressor/13425/17 "2025-12-29T10:10:11Z")

</div>

I’ve managed to fix my code and pushed it to my fork:

> <https://github.com/noughtmare/cbf-hs/commit/109d7fb757e3c0eb011103c655df156d9d6bed82>

On my machine, it improves the running time of the `cbf-bench-binary` from 2.284s to 0.288s, so almost 8x. It also reduces memory residency from 534MB to 24MB which is about 22x less and suggests it runs in constant additional memory.

---

_[View the full topic](https://discourse.haskell.org/t/help-optimizing-simple-decompressor/13425)._
