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
// used to remove listeners after test so they
// don't pile up between runs.
const cleanup = [];
// assume 1000 handlers setup in some way
const HANDLER_COUNT = 1000;
const sendEvent = (i) => {
window.postMessage(i, '*');
}
function addListener(f) {
window.addEventListener('message', f);
cleanup.push(() => {
window.removeEventListener('message', f);
});
}
cleanup.forEach(f => f());
Ready to run.
Test | Ops/sec | |
---|---|---|
one big listener that proxies |
| ready |
lots of listeners |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.