Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
In objects: shorthand vs arrow vs normal
(version: 1)
Comparing performance of:
Shorthand vs Arrow vs Normal
Created:
one year ago
by:
Guest
Jump to the latest result
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()
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (3)
Previous results
Fork
Test case name
Result
Shorthand
Arrow
Normal
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one year ago
)
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/OS:
Chrome 118 on Windows
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
Shorthand
40849080.0 Ops/sec
Arrow
42902076.0 Ops/sec
Normal
40397908.0 Ops/sec
Related benchmarks:
Closure vs arrow function
Closure vs arrow function
defineproperty vs direct assignment
func vs js object vs symbol
Arrow function vs closure function
No return vs implicit void return
return chain vs ref again
arrow vs closure
Test JS getter/setter
Comments
Confirm delete:
Do you really want to delete benchmark?