Creating classes

JavaScript performance comparison

Revision 5 of this test case created by N0N4M3pl

Preparation code


      
      <script>
Benchmark.prototype.setup = function() {
  var i, n;
  
  var data = [];
  for (i = 0, n = 1000; i < n; i++) {
     data[i] = {name: 'name_' + i, surname: 'surname_' + i};
  }
  
  var result = '';
  
  function Person(obj) {
     this.name = obj.name;
     this.surname = obj.surname;
  }
  
  Person.prototype.getName = function() {
     return this.name;
  }

};

Benchmark.prototype.teardown = function() {
  result = '';

};
</script>

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in CCBot 2.0.0 / Other 0.0.0
Test Ops/sec

Revisions

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

0 Comments