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

Delay initialization of searching, in the viewer, until the first page has rendered #10949

Merged

Conversation

Snuffleupagus
Copy link
Collaborator

When searching occurs for the first time in a document, the textContent of all pages will be fetched from the API. If there's a pending search operation when the document loads that will thus lead to a lot of getTextContent calls very early on, which may unnecessarily delay rendering of the first page. Generally, in the viewer, a number of non-essential API calls[1] will be deferred until the first page has been rendered, and there's no good reason as far as I can tell to handle searching differently.


[1] Such as e.g. getOutline and getAttachments.

…e has rendered

When searching occurs for the first time in a document, the `textContent` of all pages will be fetched from the API. If there's a pending search operation when the document loads that will thus lead to a lot of `getTextContent` calls very early on, which may unnecessarily delay rendering of the first page. Generally, in the viewer, a number of non-essential API calls[1] will be deferred until the first page has been rendered, and there's no good reason as far as I can tell to handle searching differently.

---
[1] Such as e.g. `getOutline` and `getAttachments`.
@timvandermeij
Copy link
Contributor

/botio-linux preview

@pdfjsbot
Copy link

pdfjsbot commented Jul 8, 2019

From: Bot.io (Linux m4)


Received

Command cmd_preview from @timvandermeij received. Current queue size: 0

Live output at: http://54.67.70.0:8877/3d53affc2b25d29/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Jul 8, 2019

From: Bot.io (Linux m4)


Success

Full output at http://54.67.70.0:8877/3d53affc2b25d29/output.txt

Total script time: 1.79 mins

Published

@timvandermeij timvandermeij merged commit d7afb74 into mozilla:master Jul 8, 2019
@timvandermeij
Copy link
Contributor

Looks like a good idea. Thank you!

@Snuffleupagus Snuffleupagus deleted the delay-findController-init branch July 9, 2019 07:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants