Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
unshift vs pop,push
(version: 1)
Comparing performance of:
unshift vs pop,push
Created:
one year ago
by:
Guest
Jump to the latest result
HTML Preparation code:
<!--your preparation HTML code goes here-->
Script Preparation code:
/*your preparation JavaScript code goes here To execute async code during the script preparation, wrap it as function globalMeasureThatScriptPrepareFunction, example:*/ async function globalMeasureThatScriptPrepareFunction() { // This function is optional, feel free to remove it. // await someThing(); } var arr = [42]
Tests:
unshift
arr.unshift(7)
pop,push
var a = arr.pop();arr.push(7);arr.push(a)
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
unshift
pop,push
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one year ago
)
User agent:
Mozilla/5.0 (Android 15; Mobile; rv:137.0) Gecko/137.0 Firefox/137.0
Browser/OS:
Firefox Mobile 137 on Android
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
unshift
646867.2 Ops/sec
pop,push
12869432.0 Ops/sec
Related benchmarks:
reate array by lenght
Assigning new variable
undefined to boolean
js mul vs pow
Test array ops
Hihihihi
Pushing
set vs uniq
set vs uniq2
Comments
Confirm delete:
Do you really want to delete benchmark?