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
Test name
Executions per second
Shorthand
40849080.0 Ops/sec
Arrow
42902076.0 Ops/sec
Normal
40397908.0 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()