HTML Preparation code:
AخA
 
1
<!--your preparation HTML code goes here-->
Tests:
  • Class

    x
     
    class PositionComponent {
      constructor(x, y) {
        if(typeof x !== 'number') throw new Error('x must be a number');
        if(typeof y !== 'number') throw new Error('y must be a number');
        this.x = x;
        this.y = y;
      }
    }
    for(let i = 0; i < 1000; i++) {
      const component = new PositionComponent(i, i);
    }
  • Factory

     
    const createPositionComponent = (x, y) => {
      if(typeof x !== 'number') throw new Error('x must be a number');
      if(typeof y !== 'number') throw new Error('y must be a number');
      return {
        x: x,
        y: y,
      };
    }
    for(let i = 0; i < 1000; i++) {
      const component = createPositionComponent(i, i);
    }
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Class
    Factory

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 2 months ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.6.1 Safari/605.1.15
Safari 17 on Mac OS X 10.15.7
View result in a separate tab
Test name Executions per second
Class 51980.2 Ops/sec
Factory 2758963.5 Ops/sec