Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Array.toSpliced 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 (X11; Ubuntu; Linux x86_64; rv:134.0) Gecko/20100101 Firefox/134.0
Browser:
Firefox 134
Operating system:
Ubuntu
Device Platform:
Desktop
Date tested:
one year ago
ToSpliced It
22.4M/s
filter It
11.6M/s
View exact numbers
Test name
Executions per second
✓
ToSpliced It
22,413,566 Ops/sec
filter It
11,621,901 Ops/sec
HTML Preparation code:
<script> const array = ["first","second","third","asdawd","cxzcas","ljjjln","dfh93fsad9","asdfeh5","dsag442","gdsgds","fdsfrhdgr"]; </script>
Script Preparation code:
function spliceIt(array, elementIdx){ array.toSpliced(elementIdx, 1); } function filterIt(array, elementIdx){ array = array.filter((el, idx) => idx !== elementIdx); }
Tests:
ToSpliced It
spliceIt(array, 5);
filter It
filterIt(array, 5);