getElementById vs jquery 2

Benchmark created on


Preparation HTML

<div id="main"></div>
<div id="main1"></div>
<div id="main2"></div>
<div id="main3"></div>
<div id="main4"></div>
<div id="main5"></div>
<div id="main6"></div>
<div id="main7"></div>
<div id="main8"></div>

Test runner

Ready to run.

Testing in
TestOps/sec
dom
elem = document.getElementById("main5");
ready
jquery
elem = $("#main5");
ready

Revisions

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