hooks with too many class names

JavaScript performance comparison

Test case created by Renato

Preparation code

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js">
</script>
<script src="http://yui.yahooapis.com/3.8.1/build/yui/yui-min.js"></script>
<script>
  YUI().use('node', function(Y) {
    window.ynode = Y.one;
  });
</script>
<div class="p-r ov-h fz-xxs mt-xxs mb-xxs pl-xxs pr-xxs w-100 p-r ov-h fz-xxs mt-xxs mb-xxs pl-xxs pr-xxs w-100 p-r ov-h fz-xxs mt-xxs mb-xxs pl-xxs pr-xxs w-100 p-r ov-h fz-xxs mt-xxs mb-xxs pl-xxs pr-xxs w-100 js-hook-classes">
</div>
<div class="js-hook-class">
</div>

Preparation code output

Test runner

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

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
jquery css selector (one class)
$('.js-hook-class');
pending…
jquery css selector (many classes)
$('.js-hook-classes');
pending…
yui css selector (one class)
ynode('.js-hook-class');
pending…
yui css selector (many classes)
ynode('.js-hook-classes');
pending…
native selector (one class)
document.querySelector('.js-hook-class');
pending…
native (many classes)
document.querySelector('.js-hook-classes');
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. Here’s a list of current revisions for this page:

0 comments

Add a comment