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
getElementsByTagName() vs all.tags()
Finding all elements of a given tag, 10 elements to be found, mixed content present
<div id="wrap">
<h2>This is an H2 tag</h2>
<p>This is a p tag containing text. This tag is present to provide some variance in the element content that is being queried.</p>
<span>1</span><span>2</span><span>3</span><span>4</span><span>5</span><span>6</span><span>7</span><span>8</span><span>9</span><span>10</span>
<ul>
<li>Random list item 1</li>
<li>Random list item 2</li>
<li>Random list item 3</li>
</ul>
</div>
<script>
var wrap = document.getElementById('wrap');
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
getElementsByTagName |
| ready |
all.tags |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.