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
object keys
11.0M/s
test _uniq
879/s
test Set
878/s
test filter
200/s
View exact numbers
Test name
Executions per second
✓
object keys
11,006,351 Ops/sec
test _uniq
879 Ops/sec
test Set
878 Ops/sec
test filter
200 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);