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
A simple comparison of the performance of document.getElementById vs. document.querySelector vs. document.querySelectorAll (i realise you wouldn't use this by design for a single element lookup but it's useful to know as a generic case)
<html>
<head>
</head>
<body>
<div class="wrapper">
<div class="header"></div>
<div id="footer" class="footer">
</div>
</div>
</body>
Ready to run.
Test | Ops/sec | |
---|---|---|
document.getElementById("footer") |
| ready |
document.querySelector("#footer") |
| ready |
document.querySelectorAll("#footer") |
| ready |
document.getElementsByClassName |
| ready |
queryselector of class |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.