socket.io-msgpack-parser icon indicating copy to clipboard operation
socket.io-msgpack-parser copied to clipboard

[Idea] May be consider `msgpackr`?

Open shitpoet opened this issue 3 years ago • 1 comments

msgpackr is an optimized msgpack-compatible library.

https://github.com/kriszyp/msgpackr

It has node.js native c++ extension to speed up working with strings, and so it is more on par with native JSON, at least at the node part.

Benchmarks in the article by the author show good performance

link - https://dev.doctorevidence.com/building-the-fastest-js-de-serializer-a413a2b4fb72

Note: But it should be noted that JSON.parse/stringify are benchmarked with string-to-binary and binary-to-string conversion time included. So msgpackr is still slower than JSON in browsers, where there is no custom native extension available.

I've thought may be developers of this package could be interested in exploring this. May be on some next major release on next protocol upgrade or something like that.

Feel free to close this)

shitpoet avatar Feb 10 '22 22:02 shitpoet

The number of msgpack implementations is staggering :smile:

The size of the browser bundle seems a bit bigger though:

darrachequesne avatar Feb 12 '22 22:02 darrachequesne