document.getElementById() (v8)

Revision 8 of this benchmark created on


Preparation HTML

<p id="foo">This is an element with <code>id="foo"</code>.</p>
<script>
  function $(id) {
   return document.getElementById(id);
  }
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
document.getElementById()
var d = document.getElementById('foo');
ready
$()
var d = $('foo');
ready
querySelector
var d = document.querySelector('#foo');
ready

Revisions

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