PERF666777666

Benchmark created on


Preparation HTML

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>

Setup

var json1 = {}, json0 = [],
      iterator = 1000000;
    
    for (var i = 0, l = iterator; i < l; i++) {
      var v = (new Date().getTime());
      json0[i] = {
        'key': 'o' + i,
        val: v
      };
      json1['o' + i] = v;
    }

Test runner

Ready to run.

Testing in
TestOps/sec
t1
console.log(json1.o500000);
ready
t2
console.log($.grep(json0, function(n) {
  return (n.key == "o500000");
})[0].val);
ready

Revisions

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