Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Push vs Splice
Testing whether Push vs Slice to add an element to the list has a significant performance difference.
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:135.0) Gecko/20100101 Firefox/135.0
Browser:
Firefox 135
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
Splice to add to list
15.4 Ops/sec
Push to add to list
203.4 Ops/sec
Tests:
Splice to add to list
let list = []; for (let i = 0; i < 1e6; ++i) list.splice(i, 0, i); list = [];
Push to add to list
let list = []; for (let i = 0; i < 1e6; ++i) list.push(i); list = [];