Skip to content

Commit 27a4315

Browse files
committed
chore: Unify benchmarks
1 parent ee8818b commit 27a4315

File tree

5 files changed

+86
-763
lines changed

5 files changed

+86
-763
lines changed

benchmarks/benchmarks.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[
2+
{
3+
"name": "simple",
4+
"html": "<html><head><title>Test</title><style>h1, h2 { color:blue; }strong { text-decoration:none }p { font-size:2px }p.footer { font-size: 1px}</style></head><body><h1>Big Text</h1><p><strong>Solid</strong></p><p class=\"footer\">Foot notes</p></body></html>"
5+
},
6+
{
7+
"name": "merging",
8+
"html": "<html><head><title>Test</title><style>h1, h2 { color:blue; }strong { text-decoration:none }p { font-size:2px }p.footer { font-size: 1px}</style></head><body><h1 style=\"background-color: black;\">Big Text</h1><p style=\"background-color: black;\"><strong style=\"background-color: black;\">Solid</strong></p><p class=\"footer\" style=\"background-color: black;\">Foot notes</p></body></html>"
9+
},
10+
{
11+
"name": "big_email_1",
12+
"html": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"><html><head><title>Newsletter</title><meta name=\"viewport\" content=\"width = 620\" /><style type=\"text/css\">img {margin:0}a.bluelink:link,a.bluelink:visited,a.bluelink:active {color:#5b7ab3; text-decoration: none}a.bluelink:hover {color:#5b7ab3; text-decoration: underline}</style><style media=\"only screen and (max-device-width: 480px)\" type=\"text/css\">* {line-height: normal !important; -webkit-text-size-adjust: 125%}</style></head><body bgcolor=\"#FFFFFF\" style=\"margin:0; padding:0\"><table width=\"100%\" bgcolor=\"#FFFFFF\" cellpadding=\"0\" cellspacing=\"0\" align=\"center\" border=\"2\"><tr><td style=\"padding: 30px\"><!----><table width=\"636\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\"><tr><td width=\"636\"><img src=\"http://images.apple.com/data/retail/us/topcap.gif\" border=\"0\" alt=\"\" width=\"636\" height=\"62\" style=\"display:block\" /></td></tr></table><!----><table width=\"636\" border=\"1\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\" bgcolor=\"#fffef6\"><tr><td width=\"59\" valign=\"top\" background=\"http://images.apple.com/data/retail/us/leftbg.gif\"><img src=\"http://images.apple.com/data/retail/us/leftcap.gif\" width=\"59\" height=\"302\" border=\"1\" alt=\"\" style=\"display:block\" /></td><td width=\"500\" align=\"left\" valign=\"top\"><!----><table width=\"500\" border=\"1\" cellspacing=\"0\" cellpadding=\"0\"><tr><td width=\"379\" align=\"left\" valign=\"top\"><div><img src=\"http://images.apple.com/data/retail/us/headline.gif\" width=\"330\" height=\"29\" border=\"1\" alt=\"Thanks for making a reservation.\" style=\"display:block\" /></div></td><td width=\"21\" align=\"right\" valign=\"top\"><div><img src=\"http://images.apple.com/data/retail/us/applelogo.gif\" width=\"21\" height=\"25\" border=\"1\" alt=\"\" style=\"display:block\" /></div></td></tr></table><!----><table width=\"500\" border=\"1\" cellspacing=\"0\" cellpadding=\"0\"><tr><td width=\"500\" align=\"left\" valign=\"top\"><div><img src=\"http://images.apple.com/data/retail/us/line.gif\" width=\"500\" height=\"36\" border=\"0\" alt=\"\" style=\"display:block\" /></div></td></tr></table><!----><table width=\"500\" border=\"1\" cellspacing=\"0\" cellpadding=\"0\"><tr><td width=\"10\" align=\"left\" valign=\"top\"></td><td width=\"340\" align=\"left\" valign=\"top\"><div style=\"margin: 0; padding: 2px 10px 0 0; font-family: Lucida Grande, Arial, Helvetica, Geneva, Verdana, sans-serif; color: #000000 !important; font-size:12px; line-height: 16px\">Dear peter,</div><div style=\"margin: 0; padding: 12px 10px 0 0; font-family: Lucida Grande, Arial, Helvetica, Geneva, Verdana, sans-serif; color: #000000 !important; font-size:12px; line-height: 16px\">You are scheduled for a Genius Bar appointment.</div><div style=\"margin: 0; padding: 12px 10px 0 0; font-family: Lucida Grande, Arial, Helvetica, Geneva, Verdana, sans-serif; color: #000000 !important; font-size:12px; line-height: 16px\">Topic: <b>iPhone</b></div><div style=\"margin: 0; padding: 12px 10px 0 0; font-family: Lucida Grande, Arial, Helvetica, Geneva, Verdana, sans-serif; color: #000000 !important; font-size:12px; line-height: 16px\">Date: <b>Wednesday, Aug 26, 2009</b></div><div style=\"margin: 0; padding: 12px 10px 0 0; font-family: Lucida Grande, Arial, Helvetica, Geneva, Verdana, sans-serif; color: #000000 !important; font-size:12px; line-height: 16px\">Time: <b>11:10AM</b></div><div style=\"margin: 0; padding: 12px 10px 0 0; font-family: Lucida Grande, Arial, Helvetica, Geneva, Verdana, sans-serif; color: #000000 !important; font-size:12px; line-height: 16px\">Location: <b>Apple Store, Regent Street</b></div></td><td width=\"150\" align=\"left\" valign=\"top\"><div style=\"margin: 0; padding: 2px 0 0 0; font-family: Lucida Grande, Arial, Helvetica, Geneva, Verdana, sans-serif; color:#808285; font-size:11px; line-height: 13px\">Apple Store,</div><div style=\"margin: 0; padding: 0 0 0 0; font-family: Lucida Grande, Arial, Helvetica, Geneva, Verdana, sans-serif; color:#808285; font-size:11px; line-height: 13px\">Regent Street</div><div style=\"margin: 0; padding: 7px 0 0 0; font-family: Lucida Grande, Arial, Helvetica, Geneva, Verdana, sans-serif; color:#808285; font-size:11px; line-height: 13px\"><a href=\"http://concierge.apple.com/WebObjects/RRSServices.woa/wa/ics?id=ewoJInByaW1hcnlLZXkiID0gewoJCSJyZXNlcnZhdGlvbklEIiA9ICI1ODEyMDI2NCI7Cgl9OwoJImVudGl0eU5hbWUiID0gIlJlc2VydmF0aW9uIjsKfQ%3D%3D\" style=\"font-family: Lucida Grande, Arial, Helvetica, Geneva, Verdana, sans-serif; font-size:11px; color:#5b7ab3\" class=\"bluelink\">Add this to your calendar<img src=\"http://images.apple.com/data/retail/us/bluearrow.gif\" width=\"8\" height=\"8\" border=\"0\" alt=\"\" style=\"display:inline; margin:0\" /></a></div><div style=\"margin: 0; padding: 7px 0 0 0; font-family: Lucida Grande, Arial, Helvetica, Geneva, Verdana, sans-serif; color:#808285; font-size:11px; line-height: 13px\">If you are no longer able to attend this session, please <a href=\"http://concierge.apple.com/WebObjects/Concierge.woa/wa/cancelReservation?r=ewoJInByaW1hcnlLZXkiID0gewoJCSJyZXNlcnZhdGlvbklEIiA9ICI1ODEyMDI2NCI7Cgl9OwoJImVudGl0eU5hbWUiID0gIlJlc2VydmF0aW9uIjsKfQ%3D%3D\" style=\"font-family: Lucida Grande, Arial, Helvetica, Geneva, Verdana, sans-serif; font-size:11px; color:#5b7ab3\" class=\"bluelink\">cancel</a> or <a href=\"http://concierge.apple.com/WebObjects/Concierge.woa/wa/cancelReservation?r=ewoJInByaW1hcnlLZXkiID0gewoJCSJyZXNlcnZhdGlvbklEIiA9ICI1ODEyMDI2NCI7Cgl9OwoJImVudGl0eU5hbWUiID0gIlJlc2VydmF0aW9uIjsKfQ%3D%3D\" style=\"font-family: Lucida Grande, Arial, Helvetica, Geneva, Verdana, sans-serif; font-size:11px; color:#5b7ab3\" class=\"bluelink\">reschedule</a> your reservation.</div><div style=\"margin: 0; padding: 7px 0 0 0; font-family: Lucida Grande, Arial, Helvetica, Geneva, Verdana, sans-serif; color:#808285; font-size:11px; line-height: 13px\"><a href=\"http://www.apple.com/retail/../uk/retail/regentstreet/map\" style=\"font-family: Lucida Grande, Arial, Helvetica, Geneva, Verdana, sans-serif; font-size:11px; color:#5b7ab3\" class=\"bluelink\">Get directions to the store<img src=\"http://images.apple.com/data/retail/us/bluearrow.gif\" width=\"8\" height=\"8\" border=\"0\" alt=\"\" style=\"display:inline; margin:0\" /></a></div></td></tr></table><!----><table width=\"500\" border=\"1\" cellspacing=\"0\" cellpadding=\"0\"><tr><td width=\"10\"></td><td width=\"490\" align=\"left\" valign=\"top\"><br><div style=\"margin: 0; padding: 0 20px 0 0; font-family: Lucida Grande, Arial, Helvetica, Geneva, Verdana, sans-serif; color: #000000 !important; font-size:12px; line-height: 16px\">We look forward to seeing you.</div><div style=\"margin: 0; padding: 0 20px 0 0; font-family: Lucida Grande, Arial, Helvetica, Geneva, Verdana, sans-serif; color: #000000 !important; font-size:12px; line-height: 16px\">Your Apple Store team,</div><div style=\"margin: 0; padding: 0 20px 0 0; font-family: Lucida Grande, Arial, Helvetica, Geneva, Verdana, sans-serif; color: #000000 !important; font-size:12px; line-height: 16px\">Regent Street</div></td></tr></table><!----></td><td width=\"59\" valign=\"top\" background=\"http://images.apple.com/data/retail/us/rightbg.gif\"><img src=\"http://images.apple.com/data/retail/us/rightcap.gif\" width=\"77\" height=\"302\" border=\"0\" alt=\"\" style=\"display:block\" /></td></tr></table><!----><table width=\"636\" border=\"1\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\"><tr><td width=\"636\"><img src=\"http://images.apple.com/data/retail/us/bottomcap.gif\" border=\"0\" alt=\"\" width=\"636\" height=\"62\" style=\"display:block\" /></td></tr></table><!--BEGIN FOOTER--><table width=\"498\" border=\"1\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\"><tr><td style=\"padding-top:22px\"><div style=\"font-family: Geneva, Verdana, Arial, Helvetica, sans-serif; font-size:9px; line-height: 12px; color:#b4b4b4\">TM and copyright &copy; 2008 Apple Inc. 1 Infinite Loop, MS 303-3DM, Cupertino, CA 95014.</div><div style=\"font-family: Geneva, Verdana, Arial, Helvetica, sans-serif; font-size:9px; line-height: 12px; color:#b4b4b4\"><a href=\"http://www.apple.com/legal/\" style=\"font-family: Geneva, Verdana, Arial, Helvetica, sans-serif; font-size:9px;line-height: 12px; color:#b4b4b4; text-decoration:underline\">All Rights Reserved</a> / <a href=\"http://www.apple.com/enews/subscribe/\"style=\"font-family: Geneva, Verdana, Arial, Helvetica, sans-serif; font-size:9px; line-height: 12px;color:#b4b4b4; text-decoration:underline\">Keep Informed</a> / <a href=\"http://www.apple.com/legal/privacy/\" style=\"font-family: Geneva, Verdana, Arial, Helvetica, sans-serif; font-size:9px; line-height: 12px; color:#b4b4b4; text-decoration:underline\">Privacy Policy</a> / <a href=\"https://myinfo.apple.com/cgi-bin/WebObjects/MyInfo/\" style=\"font-family: Geneva, Verdana, Arial, Helvetica, sans-serif; font-size:9px; line-height: 12px; color:#b4b4b4; text-decoration:underline\">My Info</a></div></td></tr></table><!----></td></tr></table></body></html>"
13+
},
14+
{
15+
"name": "big_email_2",
16+
"html": "<style>blockquote { background: #f9f9f9; border-left: 10px solid #ccc; margin: 1.5em 10px; padding: 0.5em; text-align: center;}blockquote:before { color: #ccc; font-size: 4em; line-height: 0.1em; margin-right: 0.25em; vertical-align: -0.4em;}blockquote p { display: inline;}.message-text { font-family: Arial; font-size: 16px; line-height: 22px; letter-spacing: 0; padding-left: 40px; padding-top: 20px;}.display-block { display: block;}.message-container { width: 70%; position: fixed; text-align: center;}.centered { margin-left: 25%; margin-right: 25%;}p { all: unset;}table, td { width: 100%;}.link { color: #767C84;}.secondary-link { text-decoration: underline; color: #2169D3;}.button { display: inline-block; text-decoration: none; max-height: 48px; border: 1px solid #37139F; border-radius: 4px; padding: 16px 40px; line-height: 16px; color: #37139F;}.button.primary { background-color: #37139F; color: #FFFFFF;}.email { font-family: \"Public Sans\", sans-serif; font-size: 14px; min-height: 100vh;}.header { padding: 16px 32px; background-color: #F8F6F3; background-image: url(\"http://localhost:8000/static/pattern-bg.png\"); background-size: 100%; background-repeat: no-repeat; max-height: 82px;}.header-image { display: inline;}.header-heading { line-height: 50px; vertical-align: bottom; margin-left: 12px; color: #1D215E; font-size: 15px;}.table-body td { padding: 0 calc((100% - 500px) / 2);}.table-body tr:not(:last-child) { height: 30px;}.table-body tr:first-child td { padding-top: 40px; padding-bottom: 32px;}.table-body tr:last-child td { padding-bottom: 40px;}.heading { color: #1D215E; font-weight: 600; font-size: 24px; line-height: 30px;}.sub-heading { font-size: 16px; line-height: 24px;}.comment { display: block; margin-top: 16px; margin-bottom: 32px; padding-left: 16px; border-left: 2px solid #B9C0C8;}.payment { border-bottom: 1px solid #E1E3E6; padding: 12px 0;}.payment-service, .payment-fee { display: inline-block;}.payment-service { width: 85%;}.payment-fee { text-align: left; vertical-align: top; float: right;}.actions { padding-top: 40px !important; padding-bottom: 52px !important; text-align: center;}.actions .button:first-child { margin-right: 16px;}.action-link { display: block; font-size: 12px; color: #767C84;}.action-link:not(:last-child) { padding-bottom: 8px;}.footer { background-color: #F8F6F3; padding: 24px 32px; text-align: center; font-size: 12px; color: #767C84; max-height: 66px;}.comment-row { padding-top: 32px !important;}.sub-table-row { color: #343A41;}.sub-table-row:not(:first-child) { margin-top: 16px;}.sub-table-main { color: #767C84; width: 25%; display: inline-block;}</style><table role=presentation aria-hidden=true class=\"email\"><thead><tr><td class=\"header\"><div class=\"header-image\"><img height=\"50\" width=\"auto\" src=\"https://storage.googleapis.com/testtest/media/public/organization/test-company/test_company_color_GatI1E3.png\" alt=\"logo Default Company\" /></div><p class=\"header-heading\">Default Company</p></td></tr></thead><tbody class=\"table-body\"><tr><td><p class=\"heading\">Default Company has updated payment details for the services related to your project.</p></td></tr><tr><td><p class=\"sub-heading\"><b>Default Company's comment:</b></p><p class=\"comment\">test comment</p></td></tr><tr><td><p class=\"sub-heading\"><b>Fees included:</b></p></td></tr><tr><td><div class=\"payment\"><p class=\"payment-service\">Fee 1</p><p class=\"payment-fee\">$120.00</p></div></td></tr><tr><td><div class=\"payment\"><p class=\"payment-service\">Fee 2</p><p class=\"payment-fee\">$130.00</p></div></td></tr><tr><td><div class=\"payment-service\"></div><div class=\"payment-fee\"><b>Total: $250.00</b></div></td></tr><tr><td class=\"actions\"><a href=\"\" class=\"button primary\">Proceed with the payment</a><a href=\"http://localhost:8000/test-company/projects/78/guide/634/\" class=\"button\">Request changes</a></td></tr><tr><td><p class=\"action-link\">Or click the link to proceed with the payment:<br><a href=\"\" class=\"link\"></a></p><p class=\"action-link\">And request changes to your request:<br><a href=\"http://localhost:8000/test-company/projects/78/guide/634/\" class=\"link\">http://localhost:8000/test-company/projects/78/guide/634/</a></p></td></tr><tr><td></td></tr></tbody><tfoot><tr><td class=\"footer\"><p>If you've received this email in error, please contact<a href=\"mailto:[email protected]\" class=\"link\">[email protected]</a></p></td></tr></tfoot></table>"
17+
}
18+
]

bindings/python/README.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -175,26 +175,26 @@ library has excellent performance characteristics. In comparison with other Pyth
175175

176176
For inlining CSS in the html document from the `Usage` section above there is the following breakdown in the benchmarks:
177177

178-
- `css_inline 0.9.0` - 13.58 us
179-
- `premailer 3.10.0` - 310.06 us (**x22.83**)
180-
- `toronado 0.1.0` - 1.43 ms (**x105.32**)
181-
- `inlinestyler 0.2.5` - 2.11 ms (**x155.46**)
182-
- `pynliner 0.8.0` - 2.51 ms (**x184.97**)
178+
- `css_inline 0.9.0` - 10.92 us
179+
- `premailer 3.10.0` - 300.28 us (**x27.49**)
180+
- `toronado 0.1.0` - 1.47 ms (**x135.27**)
181+
- `inlinestyler 0.2.5` - 2.13 ms (**x195.24**)
182+
- `pynliner 0.8.0` - 2.40 ms (**x220.51**)
183183

184184
Realistic email 1:
185185

186-
- `css_inline 0.9.0` - 266.53 us
187-
- `premailer 3.10.0` - 2.78 ms (**x10.47**)
188-
- `toronado 0.1.0` - 31.20 ms (**x117.09**)
189-
- `inlinestyler 0.2.5` - 52.64 ms (**x197.52**)
190-
- `pynliner 0.8.0` - 101.14 ms (**x379.47**)
186+
- `css_inline 0.9.0` - 244.05 us
187+
- `premailer 3.10.0` - 2.80 ms (**x11.51**)
188+
- `toronado 0.1.0` - 31.24 ms (**x128.03**)
189+
- `inlinestyler 0.2.5` - 54.01 ms (**x221.33**)
190+
- `pynliner 0.8.0` - 89.71 ms (**x367.62**)
191191

192192
Realistic email 2:
193193

194-
- `css_inline 0.9.0` - 237.23 us
195-
- `premailer 3.10.0` - 4.07 ms (**x17.24**)
194+
- `css_inline 0.9.0` - 187.51 us
195+
- `premailer 3.10.0` - 4.32 ms (**x23.06**)
196196
- `toronado 0.1.0` - `Error: Pseudo-elements are not supported`
197-
- `inlinestyler 0.2.5` - 33.87 ms (**x142.81**)
197+
- `inlinestyler 0.2.5` - 35.55 ms (**x189.60**)
198198
- `pynliner 0.8.0` - `Error: No match was found`
199199

200200
You can take a look at the benchmarks' code at `benches/bench.py` file.

0 commit comments

Comments
 (0)