Test name | Executions per second |
---|---|
Read directly from prop | 16082656.0 Ops/sec |
Set directly to prop | 16143462.0 Ops/sec |
Read from getter | 16142653.0 Ops/sec |
Set to setter | 15844874.0 Ops/sec |
class MyObj {
prop = undefined
get propAccessor() {
return this.prop;
}
set propAccessor(val) {
this.prop = val;
}
}
var obj = new MyObj();
var value = obj.prop;
obj.prop = 123;
var value = obj.propAccessor;
obj.propAccessor = 123;