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
var f1, f2, doc = document;
f1 = (function() {
var f = doc.createDocumentFragment();
f.appendChild(doc.createElement('div'));
f.appendChild(doc.createElement('div'));
f.appendChild(doc.createElement('div'));
f.appendChild(doc.createElement('div'));
var d = doc.createElement('div');
d.appendChild(doc.createElement('div'));
d.appendChild(doc.createElement('div'));
d.appendChild(doc.createElement('div'));
d.appendChild(doc.createElement('div'));
var d2 = doc.createElement('div');
d2.appendChild(doc.createElement('div'));
d2.appendChild(doc.createElement('div'));
var d3 = doc.createElement('div');
d3.setAttribute('id', 'test');
d2.appendChild(d3);
d2.appendChild(doc.createElement('div'));
d2.appendChild(doc.createElement('div'));
d.appendChild(d2);
d.appendChild(doc.createElement('div'));
d.appendChild(doc.createElement('div'));
d.appendChild(doc.createElement('div'));
d.appendChild(doc.createElement('div'));
f.appendChild(d);
f.appendChild(doc.createElement('div'));
f.appendChild(doc.createElement('div'));
f.appendChild(doc.createElement('div'));
f.appendChild(doc.createElement('div'));
return f;
})();
f2 = (function() {
var f = doc.createDocumentFragment();
f.appendChild(doc.createElement('div'));
f.appendChild(doc.createElement('div'));
f.appendChild(doc.createElement('div'));
f.appendChild(doc.createElement('div'));
var d = doc.createElement('div');
d.appendChild(doc.createElement('div'));
d.appendChild(doc.createElement('div'));
d.appendChild(doc.createElement('div'));
d.appendChild(doc.createElement('div'));
var d2 = doc.createElement('div');
d2.appendChild(doc.createElement('div'));
d2.appendChild(doc.createElement('div'));
var d3 = document.createComment('');
d2.appendChild(d3);
d2.appendChild(doc.createElement('div'));
d2.appendChild(doc.createElement('div'));
d.appendChild(d2);
d.appendChild(doc.createElement('div'));
d.appendChild(doc.createElement('div'));
d.appendChild(doc.createElement('div'));
d.appendChild(doc.createElement('div'));
f.appendChild(d);
f.appendChild(doc.createElement('div'));
f.appendChild(doc.createElement('div'));
f.appendChild(doc.createElement('div'));
f.appendChild(doc.createElement('div'));
return f;
})();
function getAtPosWithNextSibling(el, idx) {
var res = el.firstChild;
for(var i = 0; i < idx; i++) {
res = res.nextSibling;
}
return res;
}
Ready to run.
Test | Ops/sec | |
---|---|---|
comment treewalker |
| ready |
childnodes |
| ready |
direct |
| ready |
nextSibling |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.