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

faster search of a visible page for the pdf viewer #3963

Closed
wants to merge 1 commit into from

Conversation

octaeder
Copy link
Contributor

This PR improves the algorithm of how the visible page with the highest page index is found. It should be nearly a factor of gridx faster. The algorithm uses the fact that all pages of the same row have the same vertical position, i.e. they are aligned vertically. So, instead of checking all pages of each row, the algorithm checks one page per row only. For this pages in the same column are checked (and the first page of the grid if necessary).

@sunderme
Copy link
Member

though the code may be correct, it does not improve readability (rather the opposite) and for any practical document sizes, there is no real life benefit in speed optimization here.

@octaeder
Copy link
Contributor Author

ok

@sunderme sunderme closed this Jan 28, 2025
@octaeder octaeder deleted the visiblePages branch January 28, 2025 16:34
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

Successfully merging this pull request may close these issues.

2 participants