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
<div style="height: 100px; position: absolute; left: 0; right: 0; background: red">text</div>
const divElement = document.querySelector('div');
let offset = 0;
async function nextPaint() {
let resolver;
const promise = new Promise((resolve) => {
resolver = resolve;
});
window.requestAnimationFrame(resolver);
return resolver;
}
async function scootTop() {
offset++;
divElement.style.top = `${offset}px`;
await nextPaint();
}
async function scootTransform() {
offset++;
divElement.style.transform = `translateX(${offset}px)`;
await nextPaint();
}
offset = 0;
divElement.style.top = `0`;
divElement.style.transform = none;
Ready to run.
Test | Ops/sec | |
---|---|---|
top |
| ready |
transform |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.