{
"$type": "site.standard.document",
"bskyPostRef": {
"cid": "bafyreidqwioal7oobzgxq62p222i2o7jalwxzekxfkpwhs7fjiam5eloqy",
"uri": "at://did:plc:pi6woz4d47bkuws673w2il2r/app.bsky.feed.post/3mglane5kntj2"
},
"path": "/t/changing-the-binary-instance-for-double-and-float/13758?page=2#post_28",
"publishedAt": "2026-03-08T17:09:58.000Z",
"site": "https://discourse.haskell.org",
"textContent": "Check out the resources linked regarding the store package and the haskell-perf one.\n\nSerialisation libraries in Haskell have pretty straightforward characteristics that make them slower or faster. The binary package has a combination of a few inefficiencies: it has to constantly allocate as it walks the input, it has to support streaming input (meaning dereferencing where we are in the input is laden with indirection), and its default instances for types and derived instances are quite a bit bigger than more competitive libraries (3x by our recent evaluation at work). In sum, it just does a lot more work than other packages. If you don’t care about speed, transfer time or space, use that. If you do, you’ll soon hit its limits and become acquainted with the other options.\n\nI would say the difference between a serialisation package and a parser package is that both are parsers, but a “serialisation” library offers a particular format out of the box, so you can take some type from your app and serialise it somewhere for retrieval later. flat, store, persist, serialise, binary, cereal — these come with a format and derivable instances. megaparsec, attoparsec, flatparse are parsers without an accompanying derivable format.",
"title": "Changing the `Binary` instance for `Double` and `Float`"
}