Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
rehype vs htmlparser2
(version: 1)
Comparing performance of:
rehype vs htmlparser2
Created:
one year ago
by:
Registered User
Jump to the latest result
HTML Preparation code:
<script type="text/javascript" src="https://unpkg.com/rehype-parse@9.0.1/index.js"></script> <script type="text/javascript" src="https://unpkg.com/unified@11.0.5/index.js"></script> <script type="text/javascript" src="https://unpkg.com/htmlparser2@10.0.0/lib/index.js"></script>
Script Preparation code:
const rehype = unified().use(rehypeParse, { fragment: false }); const html = `<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html lang="en" dir="ltr" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:v="urn:schemas-microsoft-com:vml" > <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=yes" /> <meta name="x-apple-disable-message-reformatting" /> <meta name="format-detection" content="telephone=no, date=no, address=no, email=no, url=no" /> <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=yes" /> <meta name="x-apple-disable-message-reformatting" /> <meta name="format-detection" content="telephone=no, date=no, address=no, email=no, url=no" /> <!--[if mso ]><xml ><o:OfficeDocumentSettings ><o:AllowPNG></o:AllowPNG><o:PixelsPerInch>96</o:PixelsPerInch></o:OfficeDocumentSettings ></xml ><! [endif]--> </head> <body style="background-color:#ffffff;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif" > <div data-skip="true" style=" display: none; line-height: 1px; max-height: 0; max-width: 0; opacity: 0; overflow: hidden; " > Read undefined's review <div> </div> </div> <table align="center" width="100%" style="background-color:#ffffff;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif" border="0" cellpadding="0" cellspacing="0" role="presentation" > <tbody> <tr> <td> <div style="table-layout: fixed; width: 100%"> <div style="margin: 0 auto; max-width: 600px"> <span >><!--[if mso]><table align="center" width="600" style="border-spacing: 0; width:600px;" role="presentation"><tr><td><! [endif]--></span> <table align="center" width="100%" role="presentation" cellspacing="0" cellpadding="0" border="0" style="max-width: 600px; margin: 0 auto; padding: 20px 0 48px; width: 580px" > <tbody> <tr style="width: 100%"> <td align="center"> <table align="center" width="100%" border="0" cellpadding="0" cellspacing="0" role="presentation" > <tbody> <tr> <td> <img alt="Airbnb" src="https://jsx.email/assets/demo/airbnb-logo.png" width="96" height="30" style=" border: none; display: block; outline: none; text-decoration: none; " /> </td> </tr> </tbody> </table> <table align="center" width="100%" border="0" cellpadding="0" cellspacing="0" role="presentation" > <tbody> <tr> <td> <img width="96" height="96" style=" border: none; display: block; outline: none; text-decoration: none; margin: 0 auto; margin-bottom: 16px; border-radius: 50%; " /> </td> </tr> </tbody> </table> <table align="center" width="100%" style="padding-bottom: 20px" border="0" cellpadding="0" cellspacing="0" role="presentation" > <tbody> <tr> <td> <p style=" font-size: 32px; line-height: 1.3; margin: 16px 0; font-weight: 700; color: #484848; " > Here's what wrote </p> <p style=" font-size: 18px; line-height: 1.4; margin: 16px 0; color: #484848; padding: 24px; background-color: #f2f3f3; border-radius: 4px; " ></p> <p style=" font-size: 18px; line-height: 1.4; margin: 16px 0; color: #484848; " > Now that the review period is over, we've posted 's review to your Airbnb profile. </p> <p style=" font-size: 18px; line-height: 1.4; margin: 16px 0; color: #484848; padding-bottom: 16px; " > While it's too late to write a review of your own, you can send your feedback to using your Airbnb message thread. </p> <table align="center" width="100%" role="presentation" cellspacing="0" cellpadding="0" border="0" > <tbody style="width: 100%"> <tr style="width: 100%"></tr> </tbody> </table> <table width="100%" border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" role="presentation" > <tbody> <tr> <td align="center"> <span ><!--[if mso]> <v:roundrect href="https://airbnb.com/" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" style=" height: 60px; v-text-anchor: middle; width: 300px; " arcsize="5%" strokeweight="1px" fillcolor="#ff5a5f" > <w:anchorlock /> <center style="font-size: 18px; color: #fff"> Send My Feedback </center></v:roundrect > <![endif]--></span ><a href="https://airbnb.com/" style=" -webkit-text-size-adjust: none; border-radius: 3px; display: inline-block; font-size: 18px; line-height: 58px; max-width: 300px; text-align: center; text-decoration: none; width: 100%; background-color: #ff5a5f; color: #fff; mso-hide: all; " >Send My Feedback</a > </td> </tr> </tbody> </table> </td> </tr> </tbody> </table> </td> </tr> </tbody> </table> <hr style=" border: none; border-top: 1px solid #eaeaea; width: 100%; border-color: #cccccc; margin: 20px 0; " /> <table align="center" width="100%" border="0" cellpadding="0" cellspacing="0" role="presentation" > <tbody> <tr> <td> <p style=" font-size: 18px; line-height: 1.4; margin: 16px 0; color: #484848; font-weight: 700; " > Common questions </p> <p style="font-size: 14px; line-height: 24px; margin: 16px 0"> <a href="https://airbnb.com/help/article/13" style=" color: #ff5a5f; text-decoration: none; font-size: 18px; line-height: 1.4; display: block; " >How do reviews work?</a > </p> <p style="font-size: 14px; line-height: 24px; margin: 16px 0"> <a href="https://airbnb.com/help/article/1257" style=" color: #ff5a5f; text-decoration: none; font-size: 18px; line-height: 1.4; display: block; " >How do star ratings work?</a > </p> <p style="font-size: 14px; line-height: 24px; margin: 16px 0"> <a href="https://airbnb.com/help/article/995" style=" color: #ff5a5f; text-decoration: none; font-size: 18px; line-height: 1.4; display: block; " >Can I leave a review after 14 days?</a > </p> <hr style=" border: none; border-top: 1px solid #eaeaea; width: 100%; border-color: #cccccc; margin: 20px 0; " /> <p style=" font-size: 14px; line-height: 24px; margin: 16px 0; color: #9ca299; margin-bottom: 10px; " > Airbnb, Inc., 888 Brannan St, San Francisco, CA 94103 </p> <a href="https://airbnb.com" style="color: #9ca299; text-decoration: underline; font-size: 14px" >Report unsafe behavior</a > <table align="center" width="100%" role="presentation" cellspacing="0" cellpadding="0" border="0" > <tbody style="width: 100%"> <tr style="width: 100%"></tr> </tbody> </table> </td> </tr> </tbody> </table> </div> </div> </td> </tr> </tbody> </table> <span>><!--[if mso]></td></tr></table><![endif]--></span</span> </body> </html>`;
Tests:
rehype
[Async/Deferred]
rehype.process(html).then(deferred.resolve)
htmlparser2
htmlparser2.parseDocument(html)
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
rehype
htmlparser2
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?