-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
Significant textLayer performance regression after PR 15722 #15844
Comments
Considering: pdf.js/web/text_layer_builder.js Line 128 in cb212b2
I think the hidden thing is an oblivion. |
Very good catch ! |
Unrelated to this issue but do you think that it could be interesting to measure the strings in the worker ? |
Note that I found this issue when I noticed that zoom-performance was now extremely poor for that PDF document (zooming was never fast but now it was really bad).
Maybe, if it measurably improves performance and isn't really complicated to implement. (I'm assuming that we'd use |
[TextLayer] Hide the text layer when it's created in order to avoid reflows (fix #15844)
Attach (recommended) or Link to PDF file here: https://github.com/mozilla/pdf.js/files/1522715/wuppertal_2012.pdf
Configuration:
Steps to reproduce the problem:
Open the referenced PDF document, and measure the time it takes for the textLayer to finish rendering.
What is the expected behavior? (add screenshot)
The textLayer should render in ~7 seconds (or better).
What went wrong? (add screenshot)
The textLayer takes ~140 seconds to render.
Note that if I add
this.div.hidden = true
after the following line performance is back to normal, although it's not clear to me if that's a correct/safe solution in general.The reason that this regressed is presumably that we used to use a
DocumentFragment
for building the textLayer, but now we we're using a regulardiv
which is immediately attached to the DOM thus causing lots of invalidation during layout./cc @calixteman
The text was updated successfully, but these errors were encountered: