append vs. innerHTML vs. fragment (v22)

Revision 22 of this benchmark created on


Preparation HTML

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js">
</script>
<script src="http://3boll.com:3333/js/Js.js"></script>

Setup

var s = [
    $('<a href="#" id="addButt"></a>'),
    $('<a href="#" id="horzButt"></a>'),
    $('<div class="divider"></div>'),
    $('<div id="layoutText">LAYOUT</div>'),
    $('<a href="#" class="vert-active" id="vertButt"></a>'),
    $('<a href="#" id="inspectButton"></a>'),
    $('<div id="inspectText">Inspect</div>'),
    $('<div class="presetPos" id="button">PRESETS</div>'),
    $('<div id="track"></div>')
  ];
  
  var d = document.createElement('div');
  document.body.appendChild(d);

Teardown



            document.body.removeChild(d);
        
  

Test runner

Ready to run.

Testing in
TestOps/sec
jQuery append
$(d).append(s);
ready
innerHTML
d.innerHTML = s;
ready
my fragment method
Js.append(d, 'div', 'testid', s);
ready

Revisions

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