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

Make pdftoppm use multiple cpu cores #1

Open
ElectricRCAircraftGuy opened this issue Nov 11, 2019 · 1 comment
Open

Make pdftoppm use multiple cpu cores #1

ElectricRCAircraftGuy opened this issue Nov 11, 2019 · 1 comment
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@ElectricRCAircraftGuy
Copy link
Owner

pdftoppm is a single-threaded Program but can be made to utilize multiple cores and drastically speed up total processing time as follows:
See how many cores you have. See how many pages are in the PDF. Split the PDF into chunks. Have one process of pdftoppm per core, each processing a different chunk of the PDF. Once all processes are complete, continue on.

@ElectricRCAircraftGuy
Copy link
Owner Author

ElectricRCAircraftGuy commented Sep 6, 2023

Note to self: nproc on Linux shows the number of cores. See $(nproc) used in my answer here: https://askubuntu.com/a/1479490/327339

I could probably just use xargs for this, like I do there to unzip files in parallel:

# Unzip all files
time find . -maxdepth 1 -type f -iname "*.zip" -print0 | xargs -0 -I{} -n 1 -P $(nproc) unar -f {}

Parallelize all parts of the program where able.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant