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>
function inc(arr1, arr2) {
const arr3 = arr2.map(item => item.id);
let result = arr1.filter(item => !arr3.includes(item))
return result
}
function set(arr1, arr2) {
const set = new Set(arr2.map(item => item.id));
let result = arr1.filter(item => !set.has(item))
return result
}
</script>
const getRandomArr = len => Array.from({ length: len }).map(() => Math.ceil(Math.random * 1e6))
var arrLen = 15
var arr1 = getRandomArr(arrLen)
var arr2 = getRandomArr(arrLen)
Ready to run.
Test | Ops/sec | |
---|---|---|
inc |
| ready |
set |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.