Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
querySelectorAll vs. getElementsByTagName with enumeration
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36 Edg/143.0.0.0
Browser:
Chrome 143
Operating system:
Windows
Device Platform:
Desktop
Date tested:
4 months ago
Test name
Executions per second
querySelectorAll
652052.8 Ops/sec
getElementsByTagName
913321.2 Ops/sec
HTML Preparation code:
<table id="data-table"> <tr> <th colspan="6">Results</th> </tr> <tr> <td>No</td> <td>Competition</td> <td>John</td> <td>Adam</td> <td>Robert</td> <td>Paul</td> </tr> <tr> <td>1</td> <td>Swimming</td> <td>1:30</td> <td>2:05</td> <td>1:15</td> <td>1:41</td> </tr> <tr> <td>2</td> <td>Running</td> <td>15:30</td> <td>14:10</td> <td>15:45</td> <td>16:00</td> </tr> <tr> <td>3</td> <td>Shooting</td> <td>70%</td> <td>55%</td> <td>90%</td> <td>88%</td> </tr> </table>
Script Preparation code:
var dataTable = document.getElementById('data-table');
Tests:
querySelectorAll
for (const elem of dataTable.querySelectorAll("tr")) {}
getElementsByTagName
for (const elem of dataTable.getElementsByTagName('TR')) {}