Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
object fill test + reverse noop + while
(version: 0)
Comparing performance of:
for loop vs array fill map vs for loop (reverse noop) vs while
Created:
4 years ago
by:
Guest
Jump to the latest result
Tests:
for loop
const object = {}; for (let i=0; i<1440; i++) { object[i] = { foo: 'bar', count: 0, users: new Set(), }; }
array fill map
const object = {}; new Array(1440).fill().map((_, n) => object[n] = { foo: 'bar', count: 0, users: new Set(), });
for loop (reverse noop)
const object = {}; for (let i=1440; i>=0; --i) { object[i] = { foo: 'bar', count: 0, users: new Set(), }; }
while
const object = {}; let i = 1440; while (--i) { object[i] = { foo: 'bar', count: 0, users: new Set(), }; }
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (4)
Previous results
Fork
Test case name
Result
for loop
array fill map
for loop (reverse noop)
while
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:
Merge objects comparison
True object merge comparison
fast_deep_equal - lodash.isEqual same objects simpled test
Compare Two Objects
JavaScript spread operator vs Object.assign vs mutation performance with condition #8
Comments
Confirm delete:
Do you really want to delete benchmark?