getElementById vs. querySelector (v208)

Revision 208 of this benchmark created on


Preparation HTML

<p id="foo"><p id="bar">Foo</p></p>

Test runner

Ready to run.

Testing in
TestOps/sec
getElementById
var bar = document.getElementById("foo");
var z = bar.getElementById("bar");
ready
querySelector
var bar = document.querySelector("#foo #bar");
ready

Revisions

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