Browser Diet - jQuery Selectors

JavaScript performance comparison

Revision 26 of this test case created

Preparation code

<header class="top-header ">
        <div class="ui page grid">
            <div class="column" id="scroll-menu">
                <a href="#scroll-body"> <img class="header-logo" src="/images/logo79.png"/> </a>
                <div class="header-menu">
                    <div class="header-caption">Information & Technologies</div>
     <script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
 

Preparation code output

Information & Technologies

Test runner

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

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
context
if (!$('.test4.slim')) {
  $('.test4').addClass('slim');
pending…
selector
if (!$('.test4.slim')) {
  $('.test4').addClass('slim');();
pending…
context and find()
if (!$('.test4.slim')) {
  $('.test4').addClass('slim');
pending…
created context
if (!$('.test4.slim')) {
  $('.test4').addClass('slim');

}
pending…
selector and find
$('.test4').addClass('slim');
pending…
parent/child selector
if (!$('.test4').hasClass('slim')) {
  $('.test4').addClass('slim');

}
pending…
immediate children
if (!$('.test4').is('.slim')) {
  $('.test4').addClass('slim');

}
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