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 array = [0, 1, 20, 5, 6, 20, 3, 0, 2, 5, 0, 5, 2, 23, 0, 2, 0, 12, 3, 2, 0, 255];
function uniqFor(array) {
var i, j;
for (i = 0; i < array.length; i += 1) {
for (j = i + 1; j < array.length; j += 1) {
if (array[i] === array[j]) {
array.splice(j, 1);
j -= 1;
}
}
}
}
function uniqFilter(array) {
return array.filter(function(value, i) {
return array.indexOf(value, i + 1) === -1;
});
}
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
For |
| ready |
Filter |
| ready |
Filter inplace |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.