JSON

Benchmark created on


Setup

var src = [''];
    for (var i = 0; i <5; ++i) {
      src = src.concat(src);
    }
    var input = '[' + src.join(',') + ']';

Test runner

Ready to run.

Testing in
TestOps/sec
JSON.parse
var x = input.replace(/([\[,])(?=[\],])/g, '$1null');
var a = JSON.parse(x);
ready
eval
var a = eval('(' + input + ')');
ready

Revisions

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