Script Preparation code:
x
 
const O1 = class {
  a = 1;
  get() {
    return this.a;
  }
}
var o1 = new O1();
const O2 = function() {
  return {
    a: 1,
    get: function() {
      return this.a;
    }
  }
}
var o2 = new O2();
const O3 = function() {
  let a = 1;
  return {
    get: function() {
      return a;
    }
  }
}
var o3 = new O3();
Tests:
  • Return property class instance

     
    o1.get()
  • Return property of explicitly created object

     
    o2.get()
  • Return closure upvalue

     
    o3.get()
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Return property class instance
    Return property of explicitly created object
    Return closure upvalue

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 11 months ago)
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36
Chrome 124 on Linux
View result in a separate tab
Test name Executions per second
Return property class instance 10780022.0 Ops/sec
Return property of explicitly created object 10652499.0 Ops/sec
Return closure upvalue 10628931.0 Ops/sec