Script Preparation code:
x
 
class Point1 {
    constructor(x, y) {
        this.x = x;
        this.y = y;
    }
}
function Point3(x, y) {
    return {
        x,
        y
    }
}
Tests:
  • ES6 Class

     
    var p1 = new Point1(10, 10);
    var p2 = new Point1(10, -10);
  • Object Literal

     
    var p1 = Point3(10, 10);
    var p2 = Point3(10, -10);
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    ES6 Class
    Object Literal

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 9 days ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 Safari/537.36
Chrome 135 on Windows
View result in a separate tab
Test name Executions per second
ES6 Class 177128912.0 Ops/sec
Object Literal 159914448.0 Ops/sec