Test name | Executions per second |
---|---|
createElement | 360170.8 Ops/sec |
createElementNS | 352608.2 Ops/sec |
<div></div>
const div = document.createElement('div')
div.innerHTML = Math.random().toString();
return div.outerHTML;
const div = document.createElementNS('http://www.w3.org/1999/xhtml', 'div')
div.innerHTML = Math.random().toString();
return div.outerHTML;