Skip to content

Render PDF pages individually#173

Open
Vidminas wants to merge 1 commit intofacebookresearch:mainfrom
Vidminas:main
Open

Render PDF pages individually#173
Vidminas wants to merge 1 commit intofacebookresearch:mainfrom
Vidminas:main

Conversation

@Vidminas
Copy link
Copy Markdown

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
Copy Markdown

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