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:
4 months ago
filter It
4.3M/s
Splice It
1.1M/s
View exact numbers
Test name
Executions per second
✓
filter It
4,308,468 Ops/sec
Splice It
1,128,794 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);