Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36
Chrome 90
Windows
Desktop
3 years ago
Test name Executions per second
DOM 93350.8 Ops/sec
DomFragment 2733.9 Ops/sec
hybrid 588.7 Ops/sec
Tests:
  • DOM

    AخA
     
    const test = document.createElement('div')
    test.innerHTML = '<div>foo bar</div>'
    document.body.append(...test.childNodes)
  • DomFragment

     
    const test = document.createRange().createContextualFragment('<div>foo bar</div>')
    document.body.append(test)
  • hybrid

    x
     
    const test1 = document.createElement('div')
    const test2 = document.createRange().createContextualFragment('<div>foo bar</div>')
    test1.append(test2)
    document.body.append(...test1.childNodes)