jquery vs dojo (v2)

Revision 2 of this benchmark created on


Preparation HTML

<script src="http://code.jquery.com/jquery-1.8.3.min.js">
</script>
<script src="//ajax.googleapis.com/ajax/libs/dojo/1.8/dojo/dojo.js">
</script>
<script>
  require(['dojo/query!css3', 'dojo/dom'], function(query, dom) {
    dQuery = query;
    dById = dom.byId;
  });
</script>
<div id="container">
</div>
<div id="container2">
  <div>
    <span class="test">
      0
    </span>
  </div>
</div>

Test runner

Ready to run.

Testing in
TestOps/sec
dojoSetContent
dById("container").innerHTML = "<div><span>hello world </span></div>";
ready
jQuerySetContent
$("#container")[0].innerHTML = "<div><span>hello world </span></div>";
ready
dojoStyle
dQuery(".test", "container2").style("color", "red");
ready
jQueryStyle
$(".test", "#container2").css({
  color: "blue"
});
ready
dojoEvent
dQuery("span", "container2").on("mouseenter,mouseleave", function(e) {
  if (e.type == "mouseenter") {
    dojo.style(e.target, "color", "blue");
  }
});
ready
jQueryEvent
$("span", "#container2").hover(function() {
  $(this).css("color", "red");
}, function() {
  $(this).css("color", "black");
});
ready

Revisions

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