Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
remove duplicate
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Android 14; Mobile; rv:135.0) Gecko/135.0 Firefox/135.0
Browser:
Firefox Mobile 135
Operating system:
Android
Device Platform:
Mobile
Date tested:
one year ago
Test name
Executions per second
test Set
878.3 Ops/sec
test _uniq
878.6 Ops/sec
test filter
200.5 Ops/sec
object keys
11006351.0 Ops/sec
HTML Preparation code:
<script src='https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.5/lodash.min.js'></script>
Script Preparation code:
var array = []; for (let i = 0; i < 100000; i++) { array.push(i % 3); }
Tests:
test Set
const toto = [...new Set(array)];
test _uniq
const tata = _.uniq(array);
test filter
const uniqueArray = array.filter(function(item, pos) { return array.indexOf(item) == pos; })
object keys
const obj = {} for (let i = 0, iLen = array.lenght; i<iLen ; i++){ obj[array[i]] = true } return Object.keys(obj);