Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
sanitize-htmlq@2.14.0 vs DOMpurify@3.2.4
(version: 1)
Comparing performance of:
sanitize vs purify
Created:
one year ago
by:
Guest
Jump to the latest result
HTML Preparation code:
<script src="https://unpkg.com/sanitize-html@2.14.0/index.js"></script> <script src="https://unpkg.com/dompurify@3.2.4/dist/purify.js"></script>
Script Preparation code:
const testString = "<b>Welcome to safeland</b><br><a href='javascript:alert(1)'>This is fun</a><br><img src=x onerror=console.log(1)>"
Tests:
sanitize
const result = sanitizeHtml("<b>Welcome to safeland</b><br><a href='javascript:alert(1)'>This is fun</a><br><img src=x onerror=console.log(1)>")
purify
const result = DOMPurify.sanitize("<b>Welcome to safeland</b><br><a href='javascript:alert(1)'>This is fun</a><br><img src=x onerror=console.log(1)>")
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
sanitize
purify
Fastest:
N/A
Slowest:
N/A
Latest run results:
No previous run results
This benchmark does not have any results yet. Be the first one
to run it!
Comments
Confirm delete:
Do you really want to delete benchmark?