new function vs json

Benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
new function
var x = new

function() {
 this.test = function(a, b) {
  return a + b;
 }
};

x.test(1, 2);
ready
json
var x = {
 test: function(a, b) {
  return a + b;
 }
};

x.test(1, 2);
ready

Revisions

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