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

emacs is slow when the pdf buffer is large #273

Open
Xephobia opened this issue Apr 10, 2024 · 1 comment
Open

emacs is slow when the pdf buffer is large #273

Xephobia opened this issue Apr 10, 2024 · 1 comment

Comments

@Xephobia
Copy link

Describe the bug
When I read a pdf normally and the buffer is the only one, scrolling is very slow. But if I clone the buffer so that the resulting two buffers are smaller, scrolling is way smoother and faster.

Steps to Reproduce the behaviour

  1. Open a pdf
  2. scroll

What is the expected behaviour?
It should be faster

Desktop

  • OS: Gentoo Linux
  • Emacs Version: GNU Emacs 29.3 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.39, cairo version 1.18.0) of 2024-03-27
  • Poppler Version: 24.02.0

Your pdf-tools install
Please complete the following information:

  • pdf-tools Version:
     Status: Available from nongnu -- Install
    Archive: nongnu
    Version: 1.1.0
     Commit: a9c9a12c3ecf2005fa641059368ac8284f507620
    Summary: Support library for PDF documents
   Requires: emacs-26.3, tablist-1.0, let-alist-1.0.4
    Website: https://github.com/vedang/pdf-tools/
   Keywords: files multimedia 
 Maintainer: Vedang Manerikar <[email protected]>
     Author: Andreas Politz <[email protected]>

Additional context
Here's what I got during profiling:

        5068  96% - command-execute
        4794  91%  - funcall-interactively
        4789  91%   - mwheel-scroll
        4771  91%    - pdf-view-scroll-up-or-next-page
        4762  91%     - pdf-view-next-page
        4762  91%      - pdf-view-goto-page
        4757  90%       - pdf-view-redisplay
        4757  90%        - pdf-view-display-page
         246   4%         + pdf-view-create-page
           2   0%       + internal--before-save-selected-window
           2   0%       + doom-modeline-update-pdf-pages
           1   0%         image-mode-window-put
           9   0%     + image-scroll-up
           8   0%    + pdf-view-scroll-down-or-previous-page
           5   0%      mouse-wheel--get-scroll-window
           2   0%    + run-with-timer
           5   0%   + execute-extended-command
         274   5%  + byte-code
         156   2% + #<compiled -0x726034f3b8bc27b>
           6   0% + redisplay_internal (C function)
           2   0% + timer-event-handler
           0   0% + ...

the pdf-view-display-page function seems to be the deepest one that takes the most time

@nick4f42
Copy link

In my case, I was able to speed up pdf-view by optimizing the pdf.

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

2 participants