{
"$type": "site.standard.document",
"bskyPostRef": {
"cid": "bafyreifpsli2ndi5pgm7rkodt3is232awmw2pvsf2dpg4iqayyc7gx4stq",
"uri": "at://did:plc:pi6woz4d47bkuws673w2il2r/app.bsky.feed.post/3mgf43bwsh7q2"
},
"path": "/t/changing-the-binary-instance-for-double-and-float/13758?page=2#post_21",
"publishedAt": "2026-03-06T10:01:41.000Z",
"site": "https://discourse.haskell.org",
"tags": [
"Help optimizing simple decompressor",
"Learn"
],
"textContent": "On the other hand, when I rewrote some code to manually read the input instead of using `binary` it gave an 8x speed up:\n\nHelp optimizing simple decompressor Learn\n\n> 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.\n\nI 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.",
"title": "Changing the `Binary` instance for `Double` and `Float`"
}