nnab (v9)

Revision 9 of this benchmark created on


Description

Demonstrating the performance hit caused by nested functions.

Preparation HTML

<html>
  
  <head>
    <script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js">
    </script>
    <script>
      $(document).ready(function() {

      });
    </script>
  </head>
  
  <body>
    <p>
    </p>
  </body>

</html>

Test runner

Ready to run.

Testing in
TestOps/sec
a
for (var i = 0; i < 10; i++) {
  $("p").html("<div>a" + i + "</div>");
}
ready
b
var j = "";
for (var k = 0; k < 10; k++) {
  j += "<div>a" + k + "</div>";
}
$("p").html(j);
ready

Revisions

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