Run details:
Mozilla/5.0 (Linux; Android 10; ONEPLUS A6000) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.101 Mobile Safari/537.36
Chrome Mobile 91
Android
Mobile
3 years ago
Test name Executions per second
createElement 252.2 Ops/sec
createDocumentFragment 306.8 Ops/sec
Tests:
  • createElement

    AخA
     
    var root = document.createElement("div");
    document.body.appendChild(root);
    for (var i = 0; i < 1000; i++) {
        var e = document.createElement("span");
        e.innerText = i + " text";
        root.appendChild(e);
    }
  • createDocumentFragment

     
    var frag = document.createDocumentFragment();
    var root = document.createElement("div");
    for (var i = 0; i < 1000; i++) {
        var e = document.createElement("span");
        e.innerText = i + " text";
        root.appendChild(e);
    }
    document.body.appendChild(frag);