Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Push vs Map - add prop to object
(version: 1)
Comparing performance of:
Push vs Join
Created:
one year ago
by:
Guest
Go to the latest result
Script Preparation code:
var objs = Array.from(new Array(10000)).map(() => ({ name: 'string' })) var result = []
Tests:
Push
for (let i = 0; i < objs.length; i++) { result.push({ ...objs[i], id: i }) }
Join
result = objs.map((a, i) => ({ ...a, id: i }))
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
Push
Join
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
10 months ago
)
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:143.0) Gecko/20100101 Firefox/143.0
Browser/OS:
Firefox 143 on Windows
View result in a separate tab
Embed
Embed Benchmark Result
Join
3K/s
Push
928/s
View exact numbers
Test name
Executions per second
✓
Join
3,329 Ops/sec
Push
928 Ops/sec
Comments
Confirm delete:
Do you really want to delete benchmark?