JSON.stringify versions (v6)

Revision 6 of this benchmark created on


Description

JSON.stringify (if avail) vs custom implementations

Setup

var shortJSON = {
      "fathers|5-10": [{
        "married|0-1": true,
        "name": "@MALE_FIRST_NAME @LAST_NAME",
        "sons": null,
        "daughters|0-3": [{
          "age|0-31": 0,
          "name": "@FEMALE_FIRST_NAME"
        }]
      }]
    };
    var longJSON = '{fathers: [{married: false,name: "William Martinez",sons:null}]}';

Test runner

Ready to run.

Testing in
TestOps/sec
JSON.stringify (internal)
var x = JSON.stringify(shortJSON);
JSON.parse(x);
ready
JSON.stringify(longJSON);
var x = JSON.stringify(longJSON);
JSON.parse(x);
 
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.