Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
This variable vs scope variable accessing performance
(version: 0)
Comparing performance of:
Class this variable test vs Function scope variable test
Created:
3 years ago
by:
Guest
Jump to the latest result
Script Preparation code:
class MyClass { getValue() { return this.value } setValue(value) { this.value = value } } function MyFunc() { var value return { setValue: function(value) { this.value = value }, getValue: function(value) { return this.value } } } myClass = new MyClass() myFunc = MyFunc()
Tests:
Class this variable test
myClass.setValue("test") myClass.getValue()
Function scope variable test
myFunc.setValue("test") myFunc.getValue()
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
Class this variable test
Function scope variable test
Fastest:
N/A
Slowest:
N/A
Latest run results:
No previous run results
This benchmark does not have any results yet. Be the first one
to run it!
Related benchmarks:
class scope access - cache vs this
ES6 property (get/set) & getter/setter function vs direct access to object attribute (private and not) v2
ES6 property (get/set) & getter/setter function vs direct access vs closure
"this" property vs. closure upvalue
Comments
Confirm delete:
Do you really want to delete benchmark?