DOM API vs. Direct to string

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

Revisions

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