-
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
Only redraw after zooming is finished (bug 1661253) #15812
Conversation
a0c5182
to
ed682af
Compare
Another, and very severe effect, of these changes (that I just realized) is that this may end up slowing down parsing/rendering a fair bit in some cases. Note that if the page is currently parsing/rendering when zooming happens, we'll cancel both main-thread rendering and any worker-thread parsing via Lines 611 to 614 in 0fdac9b
Note that PR #11106 was implemented to slightly delay the worker-thread cancelling of |
ed682af
to
e38c42f
Compare
I'm not sure how I feel about it, and it's not really a complete patch yet, but we might be able work-around #15812 (comment) with something along the following lines[1]: master...Snuffleupagus:pdf.js:cancel-extraDelay [1] Where we e.g. use the |
After having thought about that, my feeling is that your patch is not that bad. |
Please note that in the normal case, when parsing/rendering actually finishes successfully, there's nothing that needs to be aborted on the worker-thread and the
It sounds like you're suggesting that the |
Could we just immediately cancel when we're scrolling and just have this computed delay when zooming/rotating ? |
Yes, if you quickly change scroll direction it may still make sense to slightly delay cancelling. E.g. consider a case where you scroll just past the page(s) you wanted to see and then scroll back quickly.
I'm not sure how much of a problem that is, and anyway if there's multiple visible (or even cached) pages we really don't want to cancel their worker-thread parsing right away since that could easily regress performance (and it's somewhat difficult to imagine every possible edge-case here).
We could possibly try to slightly reduce the default cancel-delay, to e.g.
I'll submit a separate PR, however probably not today since I'm currently sick with a cold. |
Take care of yourself. |
6c07f37
to
9a2bec1
Compare
9a2bec1
to
56b8051
Compare
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.
This is looking much better now, but I've got a few more small suggestions/questions here.
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.
Submitted twice by mistake.
56b8051
to
ed1d4ec
Compare
/botio integrationtest |
From: Bot.io (Windows)ReceivedCommand cmd_integrationtest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.193.163.58:8877/aee10a23f9f7b59/output.txt |
From: Bot.io (Linux m4)ReceivedCommand cmd_integrationtest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.241.84.105:8877/84b1c408dbec547/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.241.84.105:8877/84b1c408dbec547/output.txt Total script time: 4.31 mins
|
From: Bot.io (Windows)FailedFull output at http://54.193.163.58:8877/aee10a23f9f7b59/output.txt Total script time: 13.81 mins
|
/botio-linux preview |
From: Bot.io (Linux m4)ReceivedCommand cmd_preview from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.241.84.105:8877/1746d4cb643f676/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.241.84.105:8877/1746d4cb643f676/output.txt Total script time: 1.26 mins Published |
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.
This is so close to done now, however I found a few small issue in the latest update (see the inline comments).
ed1d4ec
to
df807cc
Compare
23c1390
to
58e8ae3
Compare
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.
Sorry about the delay in getting through this, but between being sick (multiple times) and the size/scope of the changes this was quite challenging to review.
Hopefully I've not missed anything obvious here, since I've spent quite a lot of time thinking about the "surrounding" code. However with the new preference we have a simple way to disable this functionality, should that ever become necessary.
r=me, with a couple of final comments; thank you!
Right now, the visible pages are redrawn for each scale change. Consequently, zooming with mouse wheel or in pinching can be pretty janky (even on a desktop machine but with a hdpi screen). So the main idea in this patch is to draw the visible pages only once zooming is finished.
58e8ae3
to
663007a
Compare
/botio integrationtest |
From: Bot.io (Windows)ReceivedCommand cmd_integrationtest from @calixteman received. Current queue size: 0 Live output at: http://54.193.163.58:8877/fae67d57f4cc7a7/output.txt |
From: Bot.io (Linux m4)ReceivedCommand cmd_integrationtest from @calixteman received. Current queue size: 0 Live output at: http://54.241.84.105:8877/0d417b6d5d1470e/output.txt |
From: Bot.io (Linux m4)FailedFull output at http://54.241.84.105:8877/0d417b6d5d1470e/output.txt Total script time: 4.44 mins
|
/botio-linux integrationtest |
From: Bot.io (Linux m4)ReceivedCommand cmd_integrationtest from @calixteman received. Current queue size: 0 Live output at: http://54.241.84.105:8877/fad1739a42c581e/output.txt |
From: Bot.io (Windows)FailedFull output at http://54.193.163.58:8877/fae67d57f4cc7a7/output.txt Total script time: 12.35 mins
|
From: Bot.io (Linux m4)SuccessFull output at http://54.241.84.105:8877/fad1739a42c581e/output.txt Total script time: 4.23 mins
|
Right now, the visible pages are redrawn for each scale change. Consequently, zooming with mouse wheel or in pinching can be pretty janky (even on a desktop machine but with a hdpi screen). So the main idea in this patch is to draw the visible pages only once zooming is finished.