Jquery 1.7.2 quickIs vs Jquery 2.0.0 .find()

JavaScript performance comparison

Revision 2 of this test case created by

Preparation code

<div class="someclass">Task</div>
<script src = "http://code.jquery.com/jquery-2.0.0.js"> </script>
      
<script>
Benchmark.prototype.setup = function() {
  quickIs = function( elem, m ) {
  	var attrs = elem.attributes || {};
  	return (
  		(!m[1] || elem.nodeName.toLowerCase() === m[1]) &&
  			(!m[2] || (attrs.id || {}).value === m[2]) &&
  			(!m[3] || m[3].test( (attrs[ "class" ] || {}).value ))
  		);
  }
  
  cur = $('.someclass')[0]
  sel = '.someclass';

};
</script>

Preparation code output

<div class="someclass">Task</div>

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
quickIs
quickIs(cur, sel)
pending…
find()
jQuery.find(sel, document.body, null, [cur]).length
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

Task