d3.select vs. $('this') (v2)

Revision 2 of this benchmark created on


Preparation HTML

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="http://d3js.org/d3.v2.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
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.