Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
unshift vs toSpliced
(version: 1)
Comparing performance of:
unshift vs toSpliced
Created:
5 months ago
by:
Guest
Jump to the latest result
Script Preparation code:
let test = [...Array(1000).keys()]
Tests:
unshift
test.unshift(1001)
toSpliced
test.toSpliced(0,0,1001)
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
unshift
toSpliced
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
5 months ago
)
User agent:
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:145.0) Gecko/20100101 Firefox/145.0
Browser/OS:
Firefox 145 on Ubuntu
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
unshift
615157.4 Ops/sec
toSpliced
46.4 Ops/sec
Related benchmarks:
slice-splice
splice vs unshift
Array range generating
Array: slice vs splice
Insert multiple items in an array
splice vs shift 2
splice vs shift 3
splice vs set javascript
Array add vs .unshift()
Array splice VS Array unshift
Comments
Confirm delete:
Do you really want to delete benchmark?