Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
JS filter vs splice +indexOf
JS find vs indexOf
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
Array.splice + Array.indexOf
48K/s
Array.filter
2K/s
View exact numbers
Test name
Executions per second
✓
Array.splice + Array.indexOf
48,391 Ops/sec
Array.filter
1,576 Ops/sec
Script Preparation code:
var arr = []; var i = 0; while (i <= 1E5) arr[i] = i++;
Tests:
Array.filter
const item = arr.filter(item => item !== 1E5);
Array.splice + Array.indexOf
const index = arr.splice(arr.indexOf(1E5), 1);