innerHTML vs createTextNode (1 link) (v8)

Revision 8 of this benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
innerHTML (1 link)
const root = document.createElement('div');
root.innerHTML = `text with a <a href="https://example.com/">link</a>`;
ready
createTextNode (1 link)
const root = document.createElement('div');
root.appendChild(document.createTextNode(`text with a `));
const anchor = document.createElement('a');
anchor.setAttribute("href", "https://example.com/");
anchor.appendChild(document.createTextNode(`link`));
root.appendChild(anchor);
ready

Revisions

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