Get Element By Id vs. jQuery(id) vs. d3.select(id)

Benchmark created on


Preparation HTML

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js">
</script>
<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script>
<p id="foo">
  Test
</p>

Test runner

Ready to run.

Testing in
TestOps/sec
getElementById
document.getElementById('foo');
ready
d3.select
d3.select('#foo');
ready
jQuery(id)
$('#foo')
ready

Revisions

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