Script Preparation code:
x
 
function test1(mixin) {
  return {
    a: 'a',
    b: 'b',
    c: 'c',
    d: 'd',
    e: 'e',
    f: 'f',
    ...mixin
  };
}
class Test2Class {
  constructor() {
    this.a = 'a';
    this.b = 'b';
    this.c = 'c';
    this.d = 'd';
    this.e = 'e';
    this.f = 'f';
  }
}
Test2Class.prototype.ok = function () {
  return 'ok';
};
function test2() {
  return new Test2Class();
}
Tests:
  • test1

     
    const obj1 = test1({ ok: () => 'ok' });
    obj1.ok() === 'ok'
  • test2

     
    const obj2 = test2();
    obj2.ok() === 'ok'
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    test1
    test2

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 2 years ago)
Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/110.0
Firefox 110 on Linux
View result in a separate tab
Test name Executions per second
test1 6940631.0 Ops/sec
test2 30670514.0 Ops/sec