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.removeRule(0);
Ready to run.
Test | Ops/sec | |
---|---|---|
addRule Test |
| ready |
insertRule Test |
| ready |
textContent |
| ready |
innerText |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.