Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
array.index and Array.splice vs Array.filter
Test a speed difference between these 2 approaches
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:6.8) Goanna/20260301 PaleMoon/34.1.0
Browser:
Pale Moon (Firefox Variant) 34
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one month ago
Test name
Executions per second
Splice It
1128794.5 Ops/sec
filter It
4308468.0 Ops/sec
Script Preparation code:
const toRemove = 'asdfasfd'; const array = ["first","second","third","asdawd","cxzcas", toRemove, "ljjjln","dfh93fsad9","asdfeh5","dsag442","gdsgds","fdsfrhdgr"];
Tests:
Splice It
const id = array.indexOf(toRemove); array.splice(id, 1);
filter It
array.filter(e => e != toRemove);