4 ms·
Just an update, it turns out that Typed Arrays aren't as fast as node's Buffer implementation. When comparing msgpack-js-browser to the native JSON library, JS
by creationix 14y ago
Just an update, it turns out that Typed Arrays aren't as fast as node's Buffer implementation. When comparing msgpack-js-browser to the native JSON library, JSON is way faster in chrome. http://jsperf.com/msgpack-js-vs-json http://jsperf.com/msgpack-js-vs-json
However, in the number and array heavy case, the msgpack is 2.5x smaller when serialized. So even if it's a bit slower in browsers, the bandwidth savings and the ability to store binary data may still be worth it. (remember that performance in the browser scales very differently since it's distributed across all your client's browsers)
- creationix 14y agoInterestingly, in Firefox, the gap is smaller, their typed array implementation is a bit faster. For the number heavy case, msgpack is only 47% slower which is close enough in performance for a great many use cases.