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
Tests
Using a string with a size of 100k <div>x</div>
s, wrapped in a <body>
element.
The last two methods involve creating an offline document (contrary to the first method, external resources such as <img>
are not loaded).
No error checking is added. When this test case was created, Firefox (12+) was the only browser which supported all of the three methods. The first and second test should pass on all modern browsers though (the first on ancient browsers as well!).
var testString = '<div id="test">' + Array(100001).join('<div>x</div>') + '</div>';
if (result.id !== "test") throw "wrong element"
Ready to run.
Test | Ops/sec | |
---|---|---|
innerHTML |
| ready |
createHTMLDocument |
| ready |
DOMParser |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.