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

Improve performance of PDF viewer after hack introduced #34

Open
lhl2617 opened this issue May 18, 2021 · 2 comments
Open

Improve performance of PDF viewer after hack introduced #34

lhl2617 opened this issue May 18, 2021 · 2 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@lhl2617
Copy link
Owner

lhl2617 commented May 18, 2021

See #28

Hack introduced in 0.2.2

@lhl2617 lhl2617 mentioned this issue May 18, 2021
@lhl2617
Copy link
Owner Author

lhl2617 commented May 18, 2021

The current way of point-and-click relies on forcefully rendering the entire PDF into memory, which, as expected, is very memory and computationally intensive. Further, the PDFs are rendered from page [1..n], meaning that the last page will always render last. This is non-ideal..

Optimisations:

  • Think of how to incorporate the logic used in Find to do forward PnC
    • This is super high-effort, I hate pure JS, and the PDF.js codebase makes me sad, where types :(
  • Backward PnC done for every text layer render (this should be trivial)

If the above optimisations fail:

  • Hack again to forcefully render visible views first.

@lhl2617 lhl2617 added enhancement New feature or request help wanted Extra attention is needed labels May 18, 2021
@lhl2617
Copy link
Owner Author

lhl2617 commented May 19, 2021

I tried today concat-ing the hacked getVisiblePages into a non-hacked one, meaning that the visible ones will render before all of them.

Eh, some mysterious exception--too hacky. When the need requires I'll find a way to do

Optimisations:

  • Think of how to incorporate the logic used in Find to do forward PnC

    • This is super high-effort, I hate pure JS, and the PDF.js codebase makes me sad, where types :(
  • Backward PnC done for every text layer render (this should be trivial)

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

No branches or pull requests

1 participant