hasClass (v2)

Revision 2 of this benchmark created by dgalarza on


Description

This will test a number of different alternatives for a hasClass function

Preparation HTML

<div id="test" class="a"></div>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="//github.com/dgalarza/RaptorJS/raw/master/src/raptor.pack.js"></script>
<script>
  var $p = raptor.pack;
  
  var raptor_test = document.getElementById('test');
  var jQuery_test = $('#test');
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
RaptorJS
$p.hasClass('a', raptor_test);
ready
jQuery
jQuery_test.hasClass('a');
ready
jQuery Cached
$(raptor_test).hasClass('a');
ready

Revisions

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

  • Revision 1: published by bbarr on
  • Revision 2: published by dgalarza on
  • Revision 3: published by Bruno Garcia on
  • Revision 4: published by Bruno Garcia on
  • Revision 10: published on