Script Preparation code:
x
 
class TestClass {
  
    property = Math.random();
    get property() {
        return this.property;
    }
    getProperty() {
        return this.property;
    }
};
var prototypeAccessor = new TestClass();
Tests:
  • Read from method

     
    var value = prototypeAccessor.getProperty();
  • Read from accecssor

     
    var value = prototypeAccessor.property;
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Read from method
    Read from accecssor

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 2 years ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.1 Safari/605.1.15
Safari 16 on Mac OS X 10.15.7
View result in a separate tab
Test name Executions per second
Read from method 28829506.0 Ops/sec
Read from accecssor 28655160.0 Ops/sec