Skip to content

Slightly reduce asynchronicity in the Catalog.getPageDict method (PR 14338 follow-up) #14370

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

Merged
merged 1 commit into from
Dec 15, 2021

Conversation

Snuffleupagus
Copy link
Collaborator

After the changes in PR #14338, specifically in the XRef.parse-method, the /Pages-entry will now always have been fetched/validated when the Catalog-instance is created.
Hence we can directly access the /Pages-entry in Catalog.getPageDict and thus avoid one asynchronous data-lookup per page in the document. (In practice this is unlikely to show up in e.g. benchmarks, but it really cannot hurt.)

Finally, make sure that the getPageDict/getAllPageDicts-methods track the /Pages-tree reference correctly to prevent circular references in corrupt documents.

…R 14338 follow-up)

After the changes in PR 14338, specifically in the `XRef.parse`-method, the /Pages-entry will now always have been fetched/validated when the `Catalog`-instance is created.
Hence we can directly access the /Pages-entry in `Catalog.getPageDict` and thus avoid *one* asynchronous data-lookup per page in the document. (In practice this is unlikely to show up in e.g. benchmarks, but it really cannot hurt.)

Finally, make sure that the `getPageDict`/`getAllPageDicts`-methods track the /Pages-tree reference correctly to prevent circular references in corrupt documents.
@Snuffleupagus
Copy link
Collaborator Author

/botio test

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

Command cmd_test from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.241.84.105:8877/2994589af7c184f/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

Command cmd_test from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.193.163.58:8877/8515efaa2c4bad1/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Failed

Full output at http://54.241.84.105:8877/2994589af7c184f/output.txt

Total script time: 22.72 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Integration Tests: Passed
  • Regression tests: FAILED
  different ref/snapshot: 7
  different first/second rendering: 2

Image differences available at: http://54.241.84.105:8877/2994589af7c184f/reftest-analyzer.html#web=eq.log

@pdfjsbot
Copy link

From: Bot.io (Windows)


Failed

Full output at http://54.193.163.58:8877/8515efaa2c4bad1/output.txt

Total script time: 42.20 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Integration Tests: Passed
  • Regression tests: FAILED
  different ref/snapshot: 5
  different first/second rendering: 2

Image differences available at: http://54.193.163.58:8877/8515efaa2c4bad1/reftest-analyzer.html#web=eq.log

@timvandermeij timvandermeij merged commit d3e1d70 into mozilla:master Dec 15, 2021
@timvandermeij
Copy link
Contributor

Looks good!

@Snuffleupagus Snuffleupagus deleted the getPageDict-sync-Pages branch December 18, 2021 14:14
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