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 which is faster when adding a rule to a stylesheet: insertRule or addRule.
WARNING: this may not work in all browsers. Chrome definitely has both.
NOTE: removeRule will be used in the tearDown.
<a>Test text. This text will be changed by the CSS rule.</a>
<script>
//Create and add stylesheet to page.
document.head.appendChild(document.createElement("style"));
var stylesheet =
document.styleSheets[document.styleSheets.length-1];
</script>
stylesheet.innerText = "";
Ready to run.
Test | Ops/sec | |
---|---|---|
textContent set |
| ready |
innerText set |
| ready |
textContent |
| ready |
innerText |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.