getElementById vs. querySelector (v209)

Revision 209 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 = document.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.