Element traversing nextAll with obstacles

JavaScript performance comparison

Test case created by Orkel and last updated

Preparation code

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js">
</script>
<script>
  var $current = jQuery.noConflict();
</script>
<script src="https://docs.google.com/uc?id=0B6yiDAQGhvdFZWVkNjcxZDctOWYwYS00NzdjLWFkMDUtZmM0Yjg2OTYyZjhh&export=download&hl=ru">
</script>
<script>
  var $test = jQuery.noConflict();
</script>

<div class="parent">
  <div>
    test
  </div>
 
  <!--test -->
  <![CDATA[test]]>
  test
 
  <div>
    test
  </div>
 
  <!--test -->
  <![CDATA[test]]>
  test
 
  <div id="median">
    test
  </div>
 
  <!--test -->
  <![CDATA[test]]>
  test
 
  <div>
    test
  </div>
 
  <!--test -->
  <![CDATA[test]]>
  test
 
  <div>
    test
  </div>
 
  <!--test -->
  <![CDATA[test]]>
  test
 
</div>

<script>
  var currentFirst = $current( ".parent div:first" ),
  testFirst = $test( ".parent div:first" );
</script>

Preparation code output

test
test
test
test
test
test
test
test
test
test

Test runner

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

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
current nextAll
currentFirst.nextAll();
pending…
text nextAll
testFirst.nextAll();
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