Run details:
Mozilla/5.0 (X11; Linux x86_64; rv:95.0) Gecko/20100101 Firefox/95.0
Firefox 95
Linux
Desktop
3 years ago
Test name Executions per second
DOM 260839.2 Ops/sec
DomFragment 4818.3 Ops/sec
hybrid 2662.1 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)