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

Rasterization is slow #1

Open
jpreiss opened this issue Dec 20, 2021 · 1 comment
Open

Rasterization is slow #1

jpreiss opened this issue Dec 20, 2021 · 1 comment

Comments

@jpreiss
Copy link
Owner

jpreiss commented Dec 20, 2021

It takes several seconds to rasterize a ~100-slide deck. There is probably some low-hanging performance optimization fruit still:

  • Rasterization happens in a background thread, but only one thread
  • Rasterization starts over from files every time

It is tempting to display the first slide before they are all done rasterizing, but this would introduce the possibility of navigating to a slide that is not ready to show yet, which is the whole thing we're trying to avoid (vs. Preview).

@jpreiss
Copy link
Owner Author

jpreiss commented Dec 20, 2021

It looks like pdf2image has a lot of constant overhead, so shelling out one page at a time is inefficient. Boosted performance a little with chunking. Also was busy-waiting on the queue too much.

Probably this is about the best we can do with pdf2image. The next step would be using a pdf parser library so we can only pay the read/parse penalty once, and rasterize the same data structure at different sizes. Not sure if Poppler does this or not, but probably.

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

No branches or pull requests

1 participant