querySelector vs querySelectorAll[0] (v53)

Revision 53 of this benchmark created by shel on


Description

Compare the speed of querySelector to querySelectorAll[0]

Preparation HTML

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

Test runner

Ready to run.

Testing in
TestOps/sec
querySelector
var bar = document.querySelector("#bar");
ready
querySelectorAll[0]
var bar = document.querySelectorAll("#bar")[0];
ready

Revisions

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