Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
In objects: shorthand vs arrow vs normal
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36
Browser:
Chrome 118
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Shorthand
40.0M/s
Normal
39.5M/s
Arrow
38.6M/s
View exact numbers
Test name
Executions per second
✓
Shorthand
39,995,084 Ops/sec
Normal
39,481,440 Ops/sec
Arrow
38,561,072 Ops/sec
HTML Preparation code:
<!--your preparation HTML code goes here-->
Script Preparation code:
let val = 0 const obj = { getVal() { return val; }, setVal(x) { val = x; }, getValArrow: () => { return val; }, setValArrow: (x) => { val = x; }, getValFn: function() { return val }, setValFn: function(x) { val = x }, }
Tests:
Shorthand
obj.getVal() obj.setVal(1) obj.getVal()
Arrow
obj.getValArrow() obj.setValArrow(1) obj.getValArrow()
Normal
obj.getValFn() obj.setValFn(1) obj.getValFn()