Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
test property write access
(version: 4)
Comparing performance of:
direct vs set function
Created:
8 years ago
by:
Registered User
Jump to the latest result
Script Preparation code:
var testObj1 = {a: 28, b: 82, c: "hello", d: 983, e: 'lara', property: 32, f: '82828', property1: "asd"}; function set_property(obj, prop) { obj["property"] = prop; } function set_property1(obj, prop) { obj["property1"] = prop; } var C = 1000;
Tests:
direct
var result; for (var i = 0; i < C; i++) { result = testObj1.property; testObj1["property1"] = result; }
set function
var result; for (var i = 0; i < C; i++) { result = testObj1.property; set_property1(testObj1, result); }
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
direct
set function
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:
test property access
test property read access
test property write access
Object.assign vs direct assignment Mutation2
Comments
Confirm delete:
Do you really want to delete benchmark?