querySelectorAll vs getElementById (v4)

Revision 4 of this benchmark created by Ryan Grove on


Preparation HTML

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

Test runner

Ready to run.

Testing in
TestOps/sec
querySelectorAll
var result = document.querySelectorAll('#foo');
ready
getElementById
var result = document.getElementById('foo');
ready

Revisions

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