Skip to content
This repository has been archived by the owner on Mar 24, 2024. It is now read-only.

Opening a PDF takes more than 30 minutes and causes high CPU usage #357

Open
mperry2 opened this issue Feb 13, 2023 · 1 comment
Open

Opening a PDF takes more than 30 minutes and causes high CPU usage #357

mperry2 opened this issue Feb 13, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@mperry2
Copy link

mperry2 commented Feb 13, 2023

Describe the bug
When a PDF is opened in the viewer, it will take more than 30 minutes for the PDF to appear during which anki.exe is using 90% CPU. I say "more than" because I closed Anki after 30 minutes as it clearly wasn't working. During this time the there will be a small dialog box that has a blue expanding circle animation and the text "Loading PDF" or "Initializing Reader". It spends the most time on Initializing Reader.

I tried another PDF with fewer pages and that one took 37 seconds before it appeared successfully. I'm not sure if the time taken has something to do with the number of pages or not. I have PDFs to read that are books and therefore are between 200 to 600 pages each.

I've attached both PDFs that I used so you can try to reproduce the issue.

  1. ansible_network.pdf (did not open after 30 minutes)
  2. nistspecialpublication800-145.pdf (opened in ~37 seconds)

To Reproduce
Steps to reproduce the behavior:

  1. Click on Add to open the Add window
  2. Click on Notes button -> New
  3. In New Note dialog, enter a title, then click Source button, then PDF.
  4. Choose a PDF in the file requester.
  5. Click Create in the New Note window. The window will close.
  6. Click on the PDF Notes icon (#⁠1 in first screenshot below). The new PDF file entry will appear in the window.
  7. Click on the book icon in the box with the PDF name (#⁠2 in first screenshot below). The gray PDF viewer will appear.
  8. The PDF viewer will say Loading PDF and then Initializing Reader with a blue expanding circle. Anki will use about 90% CPU. (second screenshot)

Expected behavior
I expected to see the PDF appear within a few seconds or less without excessive CPU usage.

Screenshots
PDFViewerBug1
PDFViewerBug2

Environment

  • OS: Windows 10
  • Anki version: Version 2.1.57 (6b7d372c) Python 3.9.15 Qt 6.4.2 PyQt 6.4.0
  • SIAC is the only plugin installed
@mperry2 mperry2 added the bug Something isn't working label Feb 13, 2023
@mperry2
Copy link
Author

mperry2 commented Feb 21, 2023

I did some more testing and found the following.

  • Using the Qt5 version of Anki 2.1.57 does not have the problem. PDFs open within about three seconds.
  • When using Qt6, Anki 2.1.54 works and the PDFs open within a few seconds. Newer versions of Anki Qt6 fail with the behavior described in the bug report.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant