Kimbo vs jQuery closest method

JavaScript performance comparison

Revision 3 of this test case created by Denis

Preparation code

<script src="http://kimbojs.com/lib/kimbo.js">
</script>
<script src="https://code.jquery.com/jquery-1.10.2.js">
</script>
<script src="http://zeptojs.com/zepto.min.js">
</script>
<div id="main">
  <div id="container">
    <div class="article">
      <ul class="article_menu">
        <li>
          Item 1
        </li>
      </ul>
      <div class="article">
        <p id="p">
          Actual article that shares article class styles.
        </p>
      </div>
    </div>
  </div>
</div>
<script>
  window.$k = Kimbo;
  window.$j = jQuery;
  window.$z = Zepto;
</script>
      
<script>
Benchmark.prototype.setup = function() {
  var $kp = $k('#p');
  var $jp = $j('#p');
  var $zp = $z('#p');

};
</script>

Preparation code output

<script src="https://code.jquery.com/jquery-1.10.2.js"> </script> <script src="http://zeptojs.com/zepto.min.js"> </script> <div id="main"> <div id="container"> <div class="article"> <ul class="article_menu"> <li> Item 1 </li> </ul> <div class="article"> <p id="p"> Actual article that shares article class styles. </p> </div> </div> </div> </div> <script> window.$k = Kimbo; window.$j = jQuery; window.$z = Zepto; </script>

Test runner

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

Java applet disabled.

Testing in CCBot 2.0.0 / Other 0.0.0
Test Ops/sec
Kimbo closest
$kp.closest('.article');
pending…
jQuery closest
$jp.closest('.article');
pending…
Zepto closest
$zp.closest('.article');
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.

0 Comments

  • Item 1

Actual article that shares article class styles.