4 ms·
The JavaScript msgpack codec is a couple of years old now, by the looks of the github repository. I see a custom base64 function, and no use of typed arrays. I
by dtf 14y ago
The JavaScript msgpack codec is a couple of years old now, by the looks of the github repository. I see a custom base64 function, and no use of typed arrays. I wonder if these numbers might change a little given more modern features like typed arrays and fetching arraybuffers via XHR2.
Biggest issue for me with JSON is needing to base64 any binary data, so msgpack could actually be quite useful.
- benatkin 14y agoI noticed that opportunity too. If anyone is looking for a fun project... The next thing would be to have practices and/or libraries that switch techniques based on browser support.
- creationix 14y agoIs was a fun project actually. https://github.com/creationix/msgpack-js-browser https://github.com/creationix/msgpack-js-browser
- shadytrees 14y agoQuestion out of curiosity: did you notice any performance improvements from using DataView and ArrayBuffer?
- creationix 14y agoI never used the "official" js codec because it didn't exist when I started. My codec has been optimized for nodejs and does rather well there. I recently did a jsperf for the browser port (msgpack-js-vs-json) and while slower than the nodejs version, it looks a bit faster than the "official" one.