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
is it faster to truncate long number strings so the browser can parse them faster?
<div class="faders"></div>
const fadersContainer = document.querySelector('.faders');
const faders = [];
for (let i=0; i<5000; i++) {
const el = document.createElement('div');
el.textContent = i.toFixed(3);
fadersContainer.appendChild(el);
faders.push(el);
}
faders.forEach(f => f.remove());
Ready to run.
Test | Ops/sec | |
---|---|---|
Raw Number |
| ready |
String (3dp) |
| ready |
String (15dp) |
| ready |
String (constructor) |
| ready |
String (toString) |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.