loop test (v4)

Revision 4 of this benchmark created on


Description

testing the nested loop performance.

Preparation HTML

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js">
</script>
<div id="htmlLoop">
</div>

Test runner

Ready to run.

Testing in
TestOps/sec
nested loop
var arr = [];
for (var i = 0; i < 100; i++) {
  arr.push('<tr>');
  for (var j = 0; j < 10; j++) {
    arr.push('<td></td>');
  }
  arr.push('</tr>');
}
ready
simple loop
var arr = [];
        for (var i = 0; i < 1000; i++) {
            (i % 10 === 0 ? arr.push("<tr>") : "");
            arr.push("<td></td>");
            ((i+1) % 10 === 0 ? arr.push("</tr>") : "");
        }
ready

Revisions

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