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
let big1 = Array.from({length: 1000}).map((_,i) => ({id: i}));
let big2 = Array.from({length: 1000}).map((_,i) => ({id: i*3}));
let small1 = big1.slice(0, 100);
let small2 = big2.slice(0, 100);
let mini1 = big1.slice(0, 10);
let mini2 = big2.slice(0, 10);
function setCompare(oldValues, newValues) {
let newSet = new Set(newValues.map(item => item.id));
return oldValues.filter(item => !newSet.has(item.id));
}
function filterSomeCompare(oldValues, newValues) {
return oldValues.filter(o => !newValues.some(n => n.id === o.id));
}
Ready to run.
Test | Ops/sec | |
---|---|---|
Set (mini) |
| ready |
Filter/Some (mini) |
| ready |
Set (small) |
| ready |
Filter/Some (small) |
| ready |
Set (big) |
| ready |
Filter/Some (big) |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.