jQuery on terada

JavaScript performance comparison

Test case created by jQuery on

Preparation code

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>

<style>
div { padding: 4px; margin: 4px; border: solid 1px black; }
</style>

<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div class="testdiv1" id="testdiv1">
testdiv1
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<a href="javascript:void(0)" id="clicklink1">click1</a>
<script>
$(function(){
    $('.testdiv1').bind('click', function(){
        $(this); //console.log("clicked1");
    });
    $('#clicklink1').bind('click', function(){
        $('#testdiv1').trigger('click');
    });
});
</script>


<div id="testdiv2top">
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div class="testdiv2" id="testdiv2">
testdiv2
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<a href="javascript:void(0)" id="clicklink2">click2</a>
<script>
$(function(){
    $('#testdiv2top').on('click', '.testdiv2', function(){
        $(this); //console.log("clicked2");
    });
    $('#clicklink2').bind('click', function(){
        $('#testdiv2').trigger('click');
    });
});
</script>

Preparation code output

testdiv1
click1
testdiv2
click2

Test runner

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

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
bind
$('#testdiv1').trigger('click');
pending…
on
$('#testdiv2').trigger('click');
pending…

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

Compare results of other browsers

0 comments

Add a comment