jquery vs dojo

JavaScript performance comparison

Revision 2 of this test case created

Preparation code

<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>

Preparation code output

0

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

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

Compare results of other browsers

Revisions

You can edit these tests or add even more tests to this page by appending /edit to the URL. Here’s a list of current revisions for this page:

0 comments

Add a comment