Script Preparation code:
x
 
var Klass = function() {}
Klass.prototype.foo = function(p) {
  console.log('foo ' + p);
}
function free(p) {
  console.log('foo ' + p);
}
Tests:
  • Object Function

     
    var i = 100000,
        klass = new Klass();
    while(i--) {
      klass.foo(i);
    }
  • Free Function

     
    var i = 100000;
    while(i--) {
      free(i);
    }
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Object Function
    Free Function

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 8 years ago)
Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.71 Safari/537.36
Chrome 54 on Windows
View result in a separate tab
Test name Executions per second
Object Function 1.0 Ops/sec
Free Function 0.9 Ops/sec