Script Preparation code:
x
 
class Point {
  constructor(x, y) {
    this.x = x;
    this.y = y;
  }
  tick() {
    this.x += 2;
    this.y += 2;
  }
}
var pointClasses = [];
var pointObjects = [];
for (let i = 0; i < 1000000; i++) {
  pointClasses.push(new Point(0, 0));
  pointObjects.push({ x: 0, y: 0 });
}
Tests:
  • OO-style

     
    pointClasses.forEach((point) => {
      point.tick();
    });
  • ECS-style

     
    pointObjects.forEach((point) => {
      point.x += 2;
      point.y += 2;
    });
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    OO-style
    ECS-style

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 14 days ago)
Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 Mobile Safari/537.36
Chrome Mobile 135 on Android
View result in a separate tab
Test name Executions per second
OO-style 55.3 Ops/sec
ECS-style 55.5 Ops/sec