JSON v. JSONH v. msgpack

JavaScript performance comparison

Revision 12 of this test case created by Vlad Mysla

Preparation code

<script src="//raw.github.com/uupaa/msgpack.js/master/msgpack.js"></script>
<script>
var json = JSON.stringify({
          PartnerID               : 1                                
        , APIKey                  : '4f92cd9422044bd6b68f20994cad8bc8'
        , SubsystemId             : 0  
 
        , HttpVerbTypeID          : 1
        , HttpStatus              : 200
 
        , RequestDatetime         : '2014-05-15 19:41:27.016'
 
        , PageURL                 : 'http://www.justanswer.com/law/8g93i-options-someone-used-sealed-court-documents.html'
        , ReferralURL             : 'http://www.justanswer.com/law/'
 
        , RequestGUID             : 'd3144881-8c96-4bb5-b055-68b560fb9436'
        , OriginatingRequestGUID  : ''
 
        , RouteAction             : 'page/unknown'
        , RouteActionGUID         : '214a4f03-95b7-4895-9140-6eb55741cc24'
 
        , VisitorGUID             : '3e7c3ea7-2a9a-4a51-d760-8f72a8714730'
        , ApiEncodedUserID        : 'd2bc0a1283334374b6da7be4fe31f7ab'
 
        , CookiesEnabled          : true
     });

  var StaticJSONP = {
      notify: function(uid, dummyData) {
        window.dummyData = json;
      }
    };
  "JSON" in this || document.write('<','script src="http://www.3site.eu/examples/json.hpack/test/json2.js">','<','/script>');
  document.write([
      '<','script src="http://www.3site.eu/examples/json.hpack/test/dummy.js">','<','/script>',
      '<','script src="http://www.3site.eu/examples/json.hpack/test/JSONH.js">','<','/script>',
      '<','script src="http://www.3site.eu/examples/json.hpack/test/JSONHF.js">','<','/script>'
  ].join(""));
</script>

Preparation code output

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.stringify
window.JSONresult = JSON.stringify(dummyData);
pending…
JSONH.stringify
window.JSONHresult = JSONH.stringify(dummyData);
pending…
msgpack.pack
window.msgpackresult = msgpack.pack(dummyData);
pending…
JSON.parse
window.JSONparsed = JSON.parse(JSONresult);
pending…
JSONH.parse
window.JSONHparsed = JSONH.parse(JSONHresult);
pending…
msgpack.unpack
window.msgpackparsed = msgpack.unpack(msgpackresult);
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