Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36
Chrome 120
Linux
Desktop
11 months ago
Test name Executions per second
createElement 360170.8 Ops/sec
createElementNS 352608.2 Ops/sec
HTML Preparation code:
AخA
 
1
<div></div>
Tests:
  • createElement

     
    const div = document.createElement('div')
    div.innerHTML = Math.random().toString();
    return div.outerHTML;
  • createElementNS

     
    const div = document.createElementNS('http://www.w3.org/1999/xhtml', 'div')
    div.innerHTML = Math.random().toString();
    return div.outerHTML;