Skip to content
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

Skip useless tasks in the worker to improve fast scrolling with scanned books (bug 1866296) #17403

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

calixteman
Copy link
Contributor

When a page rendering is cancelled, a task is sent to the worker but before it's executed the rendering task is: the cancel task is more or less useless in this case. So in using the fact that draining the message queue has a higher priority than draining the event one, it's possible to get all the current tasks, hence it's possible to cancel some tasks which are before a cancel task.

…ed books (bug 1866296)

When a page rendering is cancelled, a task is sent to the worker but before it's executed
the rendering task is: the cancel task is more or less useless in this case.
So in using the fact that draining the message queue has a higher priority
than draining the event one, it's possible to get all the current tasks, hence
it's possible to cancel some tasks which are before a cancel task.
@calixteman calixteman marked this pull request as ready for review December 12, 2023 20:59
Copy link
Collaborator

@Snuffleupagus Snuffleupagus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, but I still consider this really risky since if (or dare I say when) there are problems with this they are going to be highly timing-dependent and thus extremely difficult to debug.

Furthermore, based on a very quick look, once you set this.#isPostponed = true; there's nothing that ever resets it so I don't really understand how this won't also affect all sendWithPromise-calls that happen after the first sendWithStream-invocation?

Could we perhaps try my viewer-only approach first, and see how that behaves in real-life scenarios, since it should be very low risk compared to this?

@marco-c
Copy link
Contributor

marco-c commented Mar 11, 2024

This (or something along these lines) could be a nice win on mobile where fast scrolling is very frequent on long documents.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: High priority
Development

Successfully merging this pull request may close these issues.

5 participants