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
<script>
var ns = "http://www.w3.org/2000/svg";
var svg = document.createElementNS(ns, 'svg');
document.body.appendChild(svg);
var g1 = document.createElementNS(ns, 'g');
svg.appendChild(g1);
var g2 = document.createElementNS(ns, 'g');
svg.appendChild(g2);
var rect_arr = [];
var len = 20;
for (var i = 0; i < len; i++) {
var rect = document.createElementNS(ns, 'rect');
rect.setAttribute('x', i);
rect.setAttribute('y', i);
rect.setAttribute('width', i * 2);
rect.setAttribute('height', i * 3);
g1.appendChild(rect);
rect_arr.push(rect);
}
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
loop through children |
| ready |
append whole group |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.