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
Arrow
42.9M/s
Shorthand
40.8M/s
Normal
40.4M/s
View exact numbers
Test name
Executions per second
✓
Arrow
42,902,076 Ops/sec
Shorthand
40,849,080 Ops/sec
Normal
40,397,908 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()