TokTok / hs-msgpack-binary

Haskell implementation of MessagePack / msgpack.org
http://msgpack.org/
Other
16 stars 10 forks source link

Use `persist` to read/write bytestrings #77

Closed bjornbugge closed 2 years ago

bjornbugge commented 3 years ago

On AST-like tree datastructures it's about twice as fast as binary when serializing. For deserialization, it's faster on the existing benchmarks as well, but it's only half as fast as binary when writing integers.


This change is Reviewable

CLAassistant commented 3 years ago

CLA assistant check
All committers have signed the CLA.

iphydf commented 2 years ago

Thanks, the "binary" in "msgpack-binary" stands for the "binary" package. I'll make a separate package for "msgpack-persist" that this code can live in.

iphydf commented 2 years ago

I've created https://github.com/TokTok/hs-msgpack-persist and imported your code there. Thanks! It'll be available as "msgpack-persist" on hackage soon.

iphydf commented 2 years ago

@bjornbugge FYI I did some measurements on large random (Arbitrary) data:

msgpack-binary

Generating sample...
Generated msgpack array of length 522 in 10.45877556s
Message packed into 44 MiB in 6.757644817s
Packing speed: 6.511144221328494 MiB/s

msgpack-persist

Generating sample...
Generated msgpack array of length 406 in 8.216886083s
Message packed into 33 MiB in 0.490124767s
Packing speed: 67.32979482344747 MiB/s

This is only writing. I haven't done reading yet because you optimised the reading code in the Persist version so it wouldn't be a fair comparison without doing that optimisation in the Binary version as well.

Thanks again :).

bjornbugge commented 2 years ago

Hi @iphydf, sorry for my very late reaction to your messages. Thanks a lot for creating the other project and putting it on Hackage! 👍