Open adamgundry opened 1 year ago
Good catch regarding hPutBuilder
.
I suspect that withBinaryFile
won't make any difference as it (IIRC) only affects functions like System.IO.hPutStr
which may need to encode. bytestring
's put
functions shouldn't encode. Nevertheless, it wouldn't hurt to use withBinaryFile
for clarity.
While debugging a performance issue I noticed that
hPutSerialise
ends up callinghPut
ontoLazyByteString . encode
. As the comments onhPutBuilder
note:Thus I think it would be better to use
hPutBuilder
instead ofhPut
.At the same time I noticed that
writeFileSerialise
callswithFile
rather thanwithBinaryFile
. I'm not sure what difference this makes, but it seems like the latter might be a better fit?