d3.select vs. $('this')

Benchmark created on


Preparation HTML

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/d3/2.10.0/d3.v2.min.js"></script>
<section id = "main">
  <div class = "one">
    <p> One </p>
  </div>
  <div class = "two">
    <p> Two </p>
  </div>
</section>

Test runner

Ready to run.

Testing in WebKit 537.36 / undefined
TestOps/sec
jQuery
$('#main .one').css("color", "red")
ready
d3
d3.select("#main .one").style("color", "red")
ready

Revisions

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