jquery vs dojo

Benchmark created on


Preparation HTML

<script src="http://code.jquery.com/jquery-1.8.3.min.js">
</script>
 <script src="http://ajax.googleapis.com/ajax/libs/dojo/1.8.2/dojo/dojo.js"></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
 
    dojo.byId("container").innerHTML =  "<div><span>hello world </span></div>";      
    
ready
jQuerySetContent
    $("#container")[0].innerHTML = "<div><span>hello world </span></div>";    
 
ready
dojoStyle
dojo.query(".test", "container2").style("color","red" );    
ready
jQueryStyle
$("#container2 .test").css({ color: "blue" });  
ready
dojoEvent
dojo.query("#container2 span").on("mouseenter,mouseleave", function(e){    
        if(e.type == "mouseenter"){    
            dojo.style(e.target, "color", "blue");        
    }  
    });  
ready
jQueryEvent
$("#container2 span").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.