Add note about bytes serialization perfomance - #105
Conversation
|
This is great to call out, but it's not clear to me why it's faster. Consider this part of regex's docs:
This example shows me how to solve the problem, but I am left wondering what the problem is, or when to apply the solution. A great first step, for sure. |
|
@insanitybit I guess memory copy is faster than iterator over elements. It's quite easy to reproduce and speed difference is orders of magnitude https://github.com/dunnock/ipc-bench/blob/master/benches/bincode.rs: For a simple struct Without With I can also open issue and PR with test in serde (though is that the right place) if needed, let me know if I can help further |
|
Wow. This needs to be in the docs. Using |
It appears that using custom serializer/deserializer for performance benefit is not so obvious. I had an issue discussed on reddit and few people suggested solution, but for most this was quite surprising that serialization/deserialization performance for bytes array might be so slow compared of what you get when using proper module. Perf test https://github.com/dunnock/ipc-bench
Tried to highlight that in the right section of a doc.