testaske

JavaScript performance comparison

Test case created by Aske

Preparation code

<html>
  <style type="text/css">
     .content{
         display:none;
     }
  </style>
  <body>
<div id="placeHolder">
</div>
    <div class="content">
      content
      <div class="subcontent">
        sub
        <div class="subsubcontent">
          subsub
        </div>
      </div>
    </div>
    <script src="http://zeptojs.com/zepto.js">
    </script>
  </body>

</html>
<script>
Benchmark.prototype.setup = function() {
    var $content = $(".content"),
        $placeHolder = $("#placeHolder");
};
</script>

Preparation code output

content
sub
subsub

Test runner

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

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
show/hide
$content.hide();
$content.show();
 
pending…
css visibility
$content.css("display", "none");
$content.css("display", "block");
 
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