Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Object Property x Local Variable Accessing 1
(version: 1)
Comparing performance of:
Object Property vs Local Variable
Created:
one year ago
by:
Guest
Go to the latest result
Tests:
Object Property
class Bar { constructor() { this.prop = { foo: function() { } } } test() { if(this.prop.foo) { this.prop.foo() } } } const b = new Bar() b.test()
Local Variable
class Bar { constructor() { this.prop = { foo: function() { } } } test() { const foo = this.prop.foo if(foo) { foo() } } } const b = new Bar() b.test()
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
Object Property
Local Variable
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
4 months ago
)
User agent:
Mozilla/5.0 (Android 12; Mobile; rv:149.0) Gecko/149.0 Firefox/149.0
Browser/OS:
Firefox Mobile 149 on Android
View result in a separate tab
Embed
Embed Benchmark Result
Local Variable
618K/s
Object Property
610K/s
View exact numbers
Test name
Executions per second
✓
Local Variable
617,664 Ops/sec
Object Property
609,598 Ops/sec
Related benchmarks
Object Property x Local Variable Accessing
ES6 property (get/set) & getter/setter function & direct access to object attribute
es6 class static vs instance vs object method
Access property directly vs Getter/Setter
Comments
Confirm delete:
Do you really want to delete benchmark?