Script Preparation code:
x
 
class Point {
  constructor(x, y) {
    this.x = x;
    this.y = y;
    this.health = 100;
  }
  tick() {
    this.x += 2;
    this.y += 2;
    this.health -= 1;
  }
}
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();
      point.tick();
    });
  • ECS-style

     
    pointObjects.forEach((point) => {
      point.x += 2;
      point.y += 2;
      point.health -= 1;
      point.x += 2;
      point.y += 2;
      point.health -= 1;
    });
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: 18 days ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36
Chrome 134 on Mac OS X 10.15.7
View result in a separate tab
Test name Executions per second
OO-style 446.1 Ops/sec
ECS-style 337.7 Ops/sec