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
Comparing 2 different ways to dynamically insert new elements into the DOM tree.
<div id="test1"></div>
window.content = {
// a simple string to be attached via innerHTML
string: '<div>Testing innerHtml and DOM-based methods on <strong>massive</strong> add.</div>',
// a node to be attached using DOM methods
dom: (function () {
var node, strong;
node = document.createElement('div');
node.appendChild(document.createTextNode('Testing innerHtml and DOM-based methods on '));
strong = document.createElement('strong');
strong.appendChild(document.createTextNode('massive'));
node.appendChild(strong);
node.appendChild(document.createTextNode(' add.'));
return node;
})()
};
Ready to run.
Test | Ops/sec | |
---|---|---|
innerHTML |
| ready |
DocumentFragment |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.