getElementById vs. querySelector (v103)

Revision 103 of this benchmark created on


Preparation HTML

<p id="foo" role="banner">Foo</p>
<p id="bar">Bar</p>
<p id="baz">Baz</p>

Test runner

Ready to run.

Testing in
TestOps/sec
getElementById
var bar = document.getElementById("bar");
ready
querySelector
var bar = document.querySelector('[role=banner]');
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.