Script Preparation code:
AخA
 
class Class {
    constructor () {
        this._val = 1
    }
    get value() { return this._val * 2 + 1 }
    set value(x) { this._val = x }
    getValue() { return this._val * 2 + 1 }
    setValue(x) { this.val = x }
}
var cls = new Class()
var wtf
Tests:
  • ES6 property (get)

     
    wtf = cls.value
  • Getter function

     
    wtf = cls.getValue()
  • Directly get

     
    wtf = cls._val * 2 + 1
  • ES6 property (set)

     
    cls.value = 1
  • Setter function

     
    cls.setValue(1)
  • Directly set

     
    cls._val = 1
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    ES6 property (get)
    Getter function
    Directly get
    ES6 property (set)
    Setter function
    Directly set

    Fastest: N/A

    Slowest: N/A

Latest run results:

No previous run results

This benchmark does not have any results yet. Be the first one to run it!