Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
filter vs splice index
See if filter is faster than splice method for deletion
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (iPad; CPU OS 18_1_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/131.0.6778.73 Mobile/15E148 Safari/604.1
Browser:
Chrome Mobile iOS 131
Operating system:
iOS 18.1.1
Device Platform:
Tablet
Date tested:
one year ago
Test name
Executions per second
Filter
87575.8 Ops/sec
Splice
68275.4 Ops/sec
Tests:
Filter
let array = [1,2,3,4,5,6,7,8] const ignore = [2,4,7] array = array.filter(item => !ignore.includes(item)); console.log(array);
Splice
let array = [1,2,3,4,5,6,7,8] const ignore = [2,4,7] for(i = 0; i < array.length; i++) { if(ignore.includes(array[i])) { array.splice(i,1); i--; } } console.log(array);