Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Javascript multi-element splice vs. assign
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Linux x86_64; rv:152.0) Gecko/20100101 Firefox/152.0
Browser:
Firefox 152
Operating system:
Linux
Device Platform:
Desktop
Date tested:
one month ago
Assign at <extent> positions
82.4M/s
Splice at <extent> positions
7.8M/s
View exact numbers
Test name
Executions per second
✓
Assign at <extent> positions
82,401,216 Ops/sec
Splice at <extent> positions
7,782,355 Ops/sec
Script Preparation code:
const arr = new Array(10000).fill(0); const extent = 10; const sub = new Array(extent).fill(1);
Tests:
Assign at <extent> positions
for(let i=0; i<extent; i++){ arr[100+i] = sub[i]; }
Splice at <extent> positions
arr.splice(100, extent, ...sub);