Improves text rendering performance by skipping unnecessary pattern calculations#20499
Improves text rendering performance by skipping unnecessary pattern calculations#20499calixteman merged 1 commit intomozilla:masterfrom
Conversation
|
Good catch ! Thank you for the patch. |
|
@calixteman thanks for the quick review, PR is updated! |
|
/botio test |
From: Bot.io (Linux m4)ReceivedCommand cmd_test from @calixteman received. Current queue size: 0 Live output at: http://54.241.84.105:8877/542b1022030443f/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_test from @calixteman received. Current queue size: 0 Live output at: http://54.193.163.58:8877/6181da59a738123/output.txt |
From: Bot.io (Linux m4)FailedFull output at http://54.241.84.105:8877/542b1022030443f/output.txt Total script time: 39.36 mins
Image differences available at: http://54.241.84.105:8877/542b1022030443f/reftest-analyzer.html#web=eq.log |
From: Bot.io (Windows)FailedFull output at http://54.193.163.58:8877/6181da59a738123/output.txt Total script time: 77.87 mins
Image differences available at: http://54.193.163.58:8877/6181da59a738123/reftest-analyzer.html#web=eq.log |
This PR improves text rendering performance by skipping costly
strokeColor.getPattern()andfillColor.getPattern()calculations when executingshowText().Background: we noticed very slow page render speed for some particular PDFs. After investigation, it turns out that if previously a stroke/fill pattern was set, the pattern is still being calculated independent of whether it's needed or not. This caused a high CPU/memory usage and thus a slow page render speed.
This is one "example culprit" (extract from the PDF):
Here is the full pdf of the page - you can open it in Firefox to see how slow it loads:
weil-im-schoenbuch_2025_50_Seite12.pdf