createDocumentFragment vs appendChild on non-appended element (v13)

Revision 13 of this benchmark created on


Description

Justice

Preparation HTML

<form id="fform"></form>
<script>
window.fform = document.getElementById('fform')
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
Normal Append
var form = document.createElement('form'),
    array = [
        document.createElement('input'),
        document.createElement('input'),
        document.createElement('input'),
        document.createElement('input')
    ], i;
    
for (i = 0; i < 4; i +=1)
{
    form.appendChild(array[i]);
}
    
document.body.appendChild(form);
document.body.offsetHeight;
document.body.removeChild(form);
ready
Document Fragment+Form
var docfrag = document.createDocumentFragment(),
    array = [
        document.createElement('input'),
        document.createElement('input'),
        document.createElement('input'),
        document.createElement('input')
    ], i;

for (i = 0; i < 4; i +=1)
{
    docfrag.appendChild(array[i]);
}
  
document.body.appendChild(docfrag);
document.body.offsetHeight;
document.body.innerHTML = '';
ready

Revisions

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