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

A 50-page pdf file is very slow to open #55

Open
luyuanerp opened this issue Aug 31, 2022 · 2 comments
Open

A 50-page pdf file is very slow to open #55

luyuanerp opened this issue Aug 31, 2022 · 2 comments
Assignees
Labels
enhancement New feature or request optimization

Comments

@luyuanerp
Copy link

A 50-page pdf file is very slow to open, and it takes 10 minutes to open it all. What is the reason?
WX20220831-090241@2x
WX20220831-090301@2x

@ciur
Copy link
Member

ciur commented Aug 31, 2022

Good one.
I need to optimize. I cannot answer yet why it is slow, need to investigate.
In any case, thank you for heads up!

@ciur ciur self-assigned this Aug 31, 2022
@ciur ciur added optimization enhancement New feature or request labels Aug 31, 2022
@ciur ciur changed the title A 50-page pdf file is very slow to open, and it takes 10 minutes to open it all. What is the reason? A 50-page pdf file is very slow to open, and it takes 10 minutes to open it all Aug 31, 2022
@ciur ciur changed the title A 50-page pdf file is very slow to open, and it takes 10 minutes to open it all A 50-page pdf file is very slow to open Aug 31, 2022
@ciur
Copy link
Member

ciur commented Sep 15, 2022

This one is tricky.
In short, the problem is that Backend REST API server (i.e. Django application) is serving dynamic files ( i.e. files for each individual page). It would be more efficient to off load serving of the dynamic files to another, specialized service (e.g. nginx).

In your case, when you open a document with 50 pages, and each page is say 1 MB (or maybe 500k ?) and Backend (application) is trying to serve all those files at once. If you combine with the fact that each page preview is also generated at that moment + maybe there is some OCR in background, then there may be no wonder that it is slow.

So far, I did not give much thought to optimizations and I am sure I will find many ways to speed up this part.

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

No branches or pull requests

2 participants