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 scaling more performant using "currentScale". The answer is seems obviously yes although I'd argue that it is less useful. This test checks to see if that hypothesis holds.
<svg id="svg-guy" width="400" height="400" viewBox="0 0 400 400">
<g id="toscale">
<rect width="1" height="2" x="0" fill="#008d46" />
<rect width="1" height="2" x="1" fill="#ffffff" />
<rect width="1" height="2" x="2" fill="#d2232c" />
<rect width="1" height="2" x="0" fill="#008d46" />
<rect width="1" height="2" x="1" fill="#ffffff" />
<rect width="1" height="2" x="2" fill="#d2232c" />
<rect width="1" height="2" x="0" fill="#008d46" />
<rect width="1" height="2" x="1" fill="#ffffff" />
<rect width="1" height="2" x="2" fill="#d2232c" />
<rect width="1" height="2" x="0" fill="#008d46" />
<rect width="1" height="2" x="1" fill="#ffffff" />
<rect width="1" height="2" x="2" fill="#d2232c" />
</g>
</svg>
window.svgGuy = document.getElementById('svg-guy');
window.svgGuy.attributes.viewBox = '0 0 400 400';
window.myscale = 1;
window.factor = 0.80;
window.toscale = document.getElementById('toscale');
window.toscale.attributes.transform = 'scale(1)';
Ready to run.
Test | Ops/sec | |
---|---|---|
Transform Scale |
| ready |
Viewbox Scale |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.