JSON vs MessagePack

JavaScript performance comparison

Test case created by Jeff Craig

Info

This test simply compares actual serializing and deserializing

Preparation code

<script src="https://raw.github.com/msgpack/msgpack-javascript/master/msgpack.js"></script>
<script>
Benchmark.prototype.setup = function() {
    var testData = {
      foo: "bar",
      faldsj: 123,
      telas: [1, 2, "abc", 3],
      dlfaj: { foo: 1223 }
    };
};
</script>

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
JSON
var data = JSON.stringify(testData);
JSON.parse(data);
pending…
MessagePack
var data = msgpack.pack(testData);
msgpack.unpack(data);
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:

0 comments

Add a comment