Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
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) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36
Browser:
Chrome 130
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Benchmark engine:
Benchmark.js
Push to add to list
52/s
Splice to add to list
18/s
View exact numbers
Test name
Executions per second
✓
Push to add to list
52 Ops/sec
Splice to add to list
18 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 = [];