DOM API vs. Direct to string (v2)

Revision 2 of this benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
DOM API
const div = document.createElement('div');
div.innerHTML = 'This is content inside';
console.log(div.outerHTML)
ready
Straight to String
const div = `<div>This is content inside</div>`
console.log(div)
ready
DOM API w/ Text Content
const div = document.createElement('div');
div.textContent = 'This is content inside';
console.log(div.outerHTML)
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.