Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
htmlparser2@6.1.0 vs DOMParser
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36
Browser:
Chrome 124
Operating system:
Windows
Device Platform:
Desktop
Date tested:
2 years ago
Test name
Executions per second
htmlparser2
530733.6 Ops/sec
DOMParser
58884.5 Ops/sec
HTML Preparation code:
<script type="text/javascript" src="https://tosmolkadev.blob.core.windows.net/public/htmlparser2-6.1.0.js"></script>
Script Preparation code:
window.testCase = 'test <a href="https://microsoft.com">link</a>';
Tests:
htmlparser2
const result = htmlparser2.DomUtils.getOuterHTML(htmlparser2.parseDOM(testCase));
DOMParser
const result = ((new DOMParser()).parseFromString(testCase, "text/html")).body.innerHTML;