Changing the `Binary` instance for `Double` and `Float`
Haskell Community [Unofficial]
March 6, 2026
On the other hand, when I rewrote some code to manually read the input instead of using binary it gave an 8x speed up:
Help optimizing simple decompressor Learn
I’ve managed to fix my code and pushed it to my fork: 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.
I think it should be possible to write a more efficient package (maybe it already exists). flatparse is a gold standard, but it is not really meant for binary input.
Discussion in the ATmosphere