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

Remove PDFPageProxy.getJSActions caching, since it's unused, in the API #15870

Conversation

Snuffleupagus
Copy link
Collaborator

Note how, in the scripting initialization in the viewer, we only ever invoke PDFPageProxy.getJSActions once per page in order to improve overall performance; see

// Avoid sending, and thus serializing, the `actions` data more than once.
const actions = await (!visitedPages.has(pageNumber)
? pageView.pdfPage?.getJSActions()
: null);

Hence it really shouldn't be necessary to cache its result in the API, especially when that is done manually rather than using something like shadow.

… API

Note how, in the scripting initialization in the viewer, we only ever invoke `PDFPageProxy.getJSActions` *once* per page in order to improve overall performance; see https://github.com/mozilla/pdf.js/blob/a575aa13b9e4ce7e671be7794e7a7296406a3087/web/pdf_scripting_manager.js#L372-L375

Hence it really shouldn't be necessary to cache its result in the API, especially when that is done *manually* rather than using something like `shadow`.
@Snuffleupagus
Copy link
Collaborator Author

/botio unittest

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

Command cmd_unittest from @Snuffleupagus received. Current queue size: 1

Live output at: http://54.241.84.105:8877/fd1f2526044eef3/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

Command cmd_unittest from @Snuffleupagus received. Current queue size: 1

Live output at: http://54.193.163.58:8877/3844ec615dd5891/output.txt

@Snuffleupagus
Copy link
Collaborator Author

/botio integrationtest

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

Command cmd_integrationtest from @Snuffleupagus received. Current queue size: 2

Live output at: http://54.241.84.105:8877/1620f2619dd56e3/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

Command cmd_integrationtest from @Snuffleupagus received. Current queue size: 2

Live output at: http://54.193.163.58:8877/820f0a51c39ddd1/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Success

Full output at http://54.241.84.105:8877/fd1f2526044eef3/output.txt

Total script time: 2.31 mins

  • Unit Tests: Passed

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Success

Full output at http://54.241.84.105:8877/1620f2619dd56e3/output.txt

Total script time: 4.27 mins

  • Integration Tests: Passed

@pdfjsbot
Copy link

From: Bot.io (Windows)


Success

Full output at http://54.193.163.58:8877/3844ec615dd5891/output.txt

Total script time: 11.36 mins

  • Unit Tests: Passed

@pdfjsbot
Copy link

From: Bot.io (Windows)


Failed

Full output at http://54.193.163.58:8877/820f0a51c39ddd1/output.txt

Total script time: 12.19 mins

  • Integration Tests: FAILED

Copy link
Contributor

@calixteman calixteman left a comment

Choose a reason for hiding this comment

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

LGTM.

@Snuffleupagus Snuffleupagus merged commit 1dce956 into mozilla:master Dec 27, 2022
@Snuffleupagus Snuffleupagus deleted the rm-PDFPageProxy-getJSActions-caching branch December 27, 2022 12:25
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