context or selector_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">
    </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
id selector
$(function() {
  var test = $("#test");
  test.fadeOut(100);
})
pending…
native selector
$(function() {
  var test = $(document.getElementById("test"));
  test.fadeOut(100);
})
pending…
context selector
$(function() {
  var test = $(test);
  test.fadeOut(100);
})
pending…

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

Compare results of other browsers

0 comments

Add a comment