Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
length - 1 vs pop vs shift
(version: 0)
Comparing performance of:
length - 1 vs slice/pop vs slice/shift
Created:
one year ago
by:
Guest
Jump to the latest result
Script Preparation code:
var arr = []; for (let i = 0; i < 1000000; i++) { arr.push(i); }
Tests:
length - 1
for (let i = 0; i < 1000; i++) { arr.length-- }
slice/pop
for (let i = 0; i < 1000; i++) { arr.pop(); }
slice/shift
for (let i = 0; i < 1000; i++) { arr.shift(); }
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (3)
Previous results
Fork
Test case name
Result
length - 1
slice/pop
slice/shift
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!
Comments
Confirm delete:
Do you really want to delete benchmark?