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
Is querySelector faster than getElementById when called from a specific context?
<div id="app">
<main>
<h1>Welcome</h1>
<div id="content">
<h3>Current Calendars</h3>
<ul>
<li>
<span>Default</span>
</li>
<li>
<span>NASCAR Calendar</span>
—
<a id="update-cal" href="/path/to/update/url">Update</a>
·
<a id="delete-cal" href="#modal" data-calendar="1" data-title="NASCAR Calendar">Delete</a>
</li>
<li>
<span>School Calendar 2025</span>
—
<a id="update-cal" href="/path/to/update/url">Update</a>
·
<a id="delete-cal" href="#modal" data-calendar="43" data-title="School Calendar 2025">Delete</a>
</li>
<li>
<span>Holidays</span>
—
<a id="update-cal" href="/path/to/update/url">Update</a>
·
<a id="delete-cal" href="#modal" data-calendar="2" data-title="Holidays">Delete</a>
</li>
</ul>
<hr>
<button type="button"
onclick="window.open( '/path/to/create/calendar', '_self' )">Create new
calendar</button>
</div>
</main>
</div>
<dialog id="modal" data-calendar="1" data-redirect="path/to/delete/calendar/url" open="">
<p>Are you sure you want to delete <span id="cal-title">NASCAR Calendar</span>?</p>
<p>
<button type="button"
onclick="window.open( this.parentNode.parentNode.dataset.redirect, '_self' )">Yes</button>
·
<button type="button" value="cancel" onclick="this.parentNode.parentNode.close()">No</button>
</p>
</dialog>
Ready to run.
| Test | Ops/sec | |
|---|---|---|
| Query Selector | | ready |
| Get by ID | | ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.