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

Render PDF pages individually #173

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

Conversation

Vidminas
Copy link

Addresses #110

This removes multi-processing, which may or may not lead to a performance hit when loading documents with many pages. On the one hand, with this modification, nougat now uses a single process for sequential rendering of all PDF pages. On the other, it now avoids copying bitmaps across processes.

The benefit is that this makes it possible to implement nougat in already parallelised workflows (e.g., when reading multiple PDF files, each in a separate process)

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Nov 11, 2023
@mara004
Copy link

mara004 commented Nov 23, 2023

Big +1 for merging from a pypdfium2 dev POV.

Note, a major problem with the transfer is that, if receiving code is slower than the producing pool, images silently queue up in memory, which can cause enormously high memory loads.
(PNG saving particularly exhibits the problem. JPG is usually fast enough to somewhat keep up with the pool.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants