-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
⚡ [#4255] Speed up PDF generation by replacing flexbox with float #4327
⚡ [#4255] Speed up PDF generation by replacing flexbox with float #4327
Conversation
32204e1
to
8ff5702
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #4327 +/- ##
=======================================
Coverage 96.26% 96.27%
=======================================
Files 731 731
Lines 23723 23735 +12
Branches 2795 2797 +2
=======================================
+ Hits 22838 22850 +12
Misses 616 616
Partials 269 269 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting cause and solution!
I'm not happy with the layout yet, especially the wrapping after a page break and the lack of information on the first page. Perhaps that page-break-inside
is the culprit here?
I'm wondering if we should maybe apply a more column-oriented layout instead of the tabular layout now 🤔
@sergei-maertens if I remove the |
Reference of what a "normal" PDF looks like. |
flexbox (as well as alternatives such as using grid or tables) are really slow in combination with weasyprint
8ff5702
to
75483b2
Compare
flexbox (as well as alternatives such as using grid or tables) are really slow in combination with weasyprint Backport-of: #4327
flexbox (as well as alternatives such as using grid or tables) are really slow in combination with weasyprint Backport-of: #4327
flexbox (as well as alternatives such as using grid or tables) are really slow in combination with weasyprint Backport-of: #4327
Turns out that flexbox was the problem here (also mentioned at the end of this comment Kozea/WeasyPrint#578 (comment)). I didn't want to use floats, but all the alternatives I tried were just as slow 😞.
For comparison, this is what a PDF currently looks like if I enter 3500 characters in the textarea (takes about a minute to render locally, if I double the characters it exceeds the maximum):
original.pdf. I'm not sure if it's intentional that the first page does not contain any of the steps yet, but I could change that as well if needed
This is what it looks like after these CSS changes (takes about 2-3 seconds to render): fixes.pdf.
Closes #4255
Changes
Checklist
Check off the items that are completed or not relevant.
Impact on features
Release management
I have updated the translations assets (you do NOT need to provide translations)
./bin/makemessages_js.sh.sh
./bin/compilemessages_js.sh
Commit hygiene