Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.116 Safari/537.36
Chrome 53
Mac OS X 10.11.6
Other
8 years ago
Test name Executions per second
createElement 1.6 Ops/sec
cloneNode 1.5 Ops/sec
Tests:
  • createElement

    AخA
     
    var list = [],
        n = 0;
    while(true) {
        n++;
        list.push(document.createElement('div'));
        list[list.length-1].appendChild(document.createElement('div'));
        list[list.length-1].appendChild(document.createElement('div'));
        if(n===100000) 
            break;
    }
  • cloneNode

     
    var list = [],
        n = 0,
        node = document.createElement('div');
    node.appendChild(document.createElement('div'));
    node.appendChild(document.createElement('div'));
    while(true) {
        n++;
        list.push(node.cloneNode(true));
        if(n===100000) 
            break;
    }