Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
CreateElement vs DOM Parser
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:132.0) Gecko/20100101 Firefox/132.0
Browser:
Firefox 132
Operating system:
Mac OS X 10.15
Device Platform:
Desktop
Date tested:
one year ago
CreateHTMLDocument
920.5M/s
CreateElement
919.9M/s
DOMParser
919.0M/s
View exact numbers
Test name
Executions per second
✓
CreateHTMLDocument
920,475,648 Ops/sec
CreateElement
919,858,880 Ops/sec
DOMParser
919,035,136 Ops/sec
Script Preparation code:
var testString = '<body>' + Array(100001).join('<div>x</div>') + '</body>';
Tests:
CreateElement
function test_innerHTML() { var b = document.createElement('body'); b.innerHTML = testString; return b; }
CreateHTMLDocument
function test_createHTMLDocument() { var d = document.implementation.createHTMLDocument(''); d.body.innerHTML = testString; return d.body; }
DOMParser
function test_DOMParser() { return (new DOMParser).parseFromString(testString, 'text/html').body; }