jsPerf.app is an online JavaScript performance benchmark test runner & jsperf.com mirror. It is a complete rewrite in homage to the once excellent jsperf.com now with hopefully a more modern & maintainable codebase.
jsperf.com URLs are mirrored at the same path, e.g:
https://jsperf.com/negative-modulo/2
Can be accessed at:
https://jsperf.app/negative-modulo/2
<script>
var utils = {
uniq: function(arr) {
var temp = {}, l = arr.length, result = [];
while(l) !temp[arr[--l].id] && result.unshift(arr[l]) && (temp[arr[l].id] = 1);
return result;
},
uniqDouble: function(arr) {
var temp = {}, l = arr.length, result = [];
while(l) temp[arr[--l].id] = arr[l];
for (var k in temp) result.push(temp[k]);
return result;
}
}
</script>
var array = [
{ id: 1 },
{ id: 2 },
{ id: 3 },
{ id: 4 },
{ id: 5 },
{ id: 6 },
{ id: 7 },
{ id: 8 },
{ id: 9 },
{ id: 9 },
{ id: 10 },
{ id: 1, new: true },
{ id: 2, new: true },
{ id: 3, new: true }
]
Ready to run.
Test | Ops/sec | |
---|---|---|
single loop |
| ready |
double loop |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.