Msgpack-js vs JSON
JavaScript performance comparison
Info
Comparing the speed of msgpack-js using typed arrays against JSON.parse and JSON.stringify
Preparation code
<script src="https://raw.github.com/creationix/msgpack-js-browser/master/msgpack.js">
</script>
<script>
Benchmark.prototype.setup = function() {
var stringData = {{"principal_code": "benjo"}};
var numberData = [
[1, 2, 3, 4, -1, true, null],
[3, 6, 5, 4, 1, false, 7],
[3, 2, 8, 1, 0, true, 0],
[10, 11, 12, 13, 14, false, true],
[15, 16, 17, 18, 19, true, null],
[20, 21, 22, 23, 24, false, 7],
[25, 26, 27, 28, 29, true, 0], 100, 200, 300, [
[1, 0, 0, 0, 0],
[0, 1, 0, 0, 0],
[0, 0, 1, 0, 0],
[0, 0, 0, 1, 0],
[0, 0, 0, 0, 1]
]
]
};
</script>
Test runner
Warning! For accurate results, please disable Firebug before running the tests. (Why?)
Java applet disabled.
| Test | Ops/sec | |
|---|---|---|
JSON strings |
|
pending… |
JSON numbers |
|
pending… |
MsgPack strings |
|
pending… |
MsgPack numbers |
|
pending… |
Compare results of other browsers
Revisions
You can edit these tests or add even more tests to this page by appending /edit to the URL. Here’s a list of current revisions for this page:
- Revision 1: published by Tim Caswell
- Revision 2: published
- Revision 3: published
- Revision 4: published
- Revision 5: published
0 comments