Script Preparation code:
x
 
function PersonFunction(s) {
  this.e = 'hello '+s;
}
PersonFunction.prototype.say = function(){
    console.log(this.e)
}
class PersonClass{
    constructor(s){
        this.e = 'hello '+s;
    }
    say(){
        console.log(this.e)
    }
}
Tests:
  • Classes

     
    var person1 = new PersonFunction('world');
  • Prototype

     
    var person2 = new PersonClass('world');
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Classes
    Prototype

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: one month ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36 Edg/134.0.0.0
Chrome 134 on Windows
View result in a separate tab
Test name Executions per second
Classes 73693336.0 Ops/sec
Prototype 76963720.0 Ops/sec