Element traversing siblings with obstacles

Benchmark created by Orkel on


Preparation HTML

<script src="https://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 testMedian = $test( "#median" ),
  currentMedian = $current( "#median" );
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
current siblings
currentMedian.siblings();
ready
test siblings
testMedian.siblings();
ready

Revisions

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

  • Revision 1: published by Orkel on