jQuery find performance

JavaScript performance comparison

Revision 2 of this test case created

Preparation code

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

<table id="tbl" style="border: solid 1px black">  
        <tr>  
            <td class="class1">  
                1  
            </td>  
            <td class="class2">  
                a  
            </td>  
        </tr>  
        <tr>  
            <td class="class1">  
                2  
            </td>  
            <td class="class2">  
                b  
            </td>  
        </tr>  
        <tr>  
            <td class="class1">  
                3  
            </td>  
            <td class="class2">  
                c  
            </td>  
        </tr>  
    </table>  

Preparation code output

1 a
2 b
3 c

Test runner

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

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
Separate finds
var $Result1 = $('#tbl');
$Result1.find('.class1').hide();
$Result1.find('.class2').hide();
pending…
1 find
var $Result2 = $('#tbl');
$Result2.find('.class1, .class2').hide();
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