Uso de id

JavaScript performance comparison

Test case created by Luís Soares

Preparation code

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js">
</script>
<div class='bloco'>
  <ul id='lista1'>
    <li>
      aaaaaaaaaaaaaaaa
    </li>
    <li>
      bbbbbbbbbbbbbbbb
    </li>
    <li>
      cccccccccccccccc
    </li>
    <li>
      dddddddddddddddd
    </li>
    <li>
      eeeeeeeeeeeeeeee
    </li>
    <li>
      ffffffffffffffff
    </li>
    <li>
      gggggggggggggggg
    </li>
  </ul>
</div>

Preparation code output

  • aaaaaaaaaaaaaaaa
  • bbbbbbbbbbbbbbbb
  • cccccccccccccccc
  • dddddddddddddddd
  • eeeeeeeeeeeeeeee
  • ffffffffffffffff
  • gggggggggggggggg

Test runner

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

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
Não fazer uso do id.
$('.bloco ul');
pending…
Fazer uso do id.
$('#lista1');
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