jquery class selector test_01

JavaScript performance comparison

Test case created

Preparation code

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
 
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>
      無題ドキュメント
    </title>
  </head>
 
  <body>
    <div id="test">
      <p class="text">
      </p>
    </div>
    <script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js">
    </script>
  </body>

</html>

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
tag + className
$(function() {
  var test = $("#test");
  test.find("p.text").fadeIn(100);
})
pending…
tag none + className
$(function() {
  var test = $("#test");
  test.find(".text").fadeIn(100);
})
pending…
tag none + className + native
$(function() {
  var test = $("#test");
  test.find(document.getElementsByClassName("text")).fadeIn(100);
})
pending…
tag + className_02
$(function() {
  var test = $(test);
  test.find("p.text").fadeIn(100);
})
pending…
tag + className_03
$(function() {
  var test = $(document.getElementById("test"));
  test.find("p.text").fadeIn(100);
})
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