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
Jump 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:
one month 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
Test name
Executions per second
Object Property
609597.8 Ops/sec
Local Variable
617663.6 Ops/sec
Related benchmarks:
test for null(2)
Object Property x Local Variable Accessing
Ts trivial getter vs method
ES6 property (get/set) & getter/setter function & direct access to object attribute
es6 class static vs prototype
es6 class static vs prototype2
es6 class static vs instance vs object method
Assign vs Destructure
Access property directly vs Getter/Setter
Comments
Confirm delete:
Do you really want to delete benchmark?