find and children

JavaScript performance comparison

Revision 4 of this test case created

Preparation code

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
 
<script>
Benchmark.prototype.setup = function() {
    < !document > < html > < head > < /head>
    <body>
    <div class="a">
    <b class="b">999<i class="c">000</i > < /b>
    <b class="bb">1111</b > < b class = "bbb" > 222 < /b>
    </div > < /body>
    </html >
};
</script>

Preparation code output

Test runner

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

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
find
$(document).ready(function() {
  $('.a').find('.b').css('color', '#f00');
});
pending…
children
(function() {
  $('.a').children("b").css('color', '#f00');
})();
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