Bug 412616 - GUI hangs with big pdf
Summary: GUI hangs with big pdf
Status: RESOLVED NOT A BUG
Alias: None
Product: okular
Classification: Applications
Component: PDF backend (show other bugs)
Version: 1.7.3
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-10-04 19:27 UTC by Richard Llom
Modified: 2020-02-09 23:17 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Llom 2019-10-04 19:27:09 UTC
SUMMARY
When I open this pdf: https://www.schraeder.com/images/PDF/Fibel_Waermerueckgewinnung.pdf, scroll in the middle of the document and then change to another tab the GUI is hanging and I cannot scroll in the other document for a couple of seconds. When I switch to it GUI is hanging again for some time. I can repeat this for at least 50 seconds until the pdf fully is loaded/rendered and there are no hangs anymore.
During all the time my 4-core CPU uses just about 113% (from 400%) and other programs work just fine.

I have set memory performance to greedy, but this also happens under normal settings.

CPU info:
Quad Core model: AMD A10-7850K Radeon R7 12 Compute Cores 4C+8G bits: 64 type: MCP 
L2 cache: 2048 KiB 
Speed min/max: 1700/3700 MHz


STEPS TO REPRODUCE
1. Open any pdf document
2. open https://www.schraeder.com/images/PDF/Fibel_Waermerueckgewinnung.pdf
3. fast scroll to middle of document
4. switch tab to pdf from 1.

OBSERVED RESULT
GUI hangs

EXPECTED RESULT
GUI shoud'nt hang


SOFTWARE/OS VERSIONS
Operating System:  
KDE Plasma Version: 5.16.3
KDE Frameworks Version: 5.60.0
Qt Version: 5.12.4
Kernel Version: 4.19.26-1-CHAKRA
OS Type: 64-bit
Processors: 4 × AMD A10-7850K Radeon R7, 12 Compute Cores 4C+8G
Memory: 14,7 GiB of RAM
Comment 1 Patrick Silva 2020-02-07 15:25:17 UTC
okular 1.9.2 hangs even without scrolling.

Operating System: Arch Linux 
KDE Plasma Version: 5.17.90
KDE Frameworks Version: 5.66.0
Qt Version: 5.14.1
Comment 2 Tobias Deiminger 2020-02-07 20:02:46 UTC
When using poppler command line tool
$ pdfimages -list Fibel_Waermerueckgewinnung.pdf
it takes > 2 minutes to generate information about 50 embedded images. I'd say that's peculiarly slow, we should have a closer look (will do, but need to find some time) and we should probably track the issue at poppler.
Comment 3 Tobias Deiminger 2020-02-09 22:52:24 UTC
For whatever reason the document contains 166152 radial shading fills, each using a 3-samples, linear-interpolating color function. Poppler spends ~80% of overall processing time there. IOW, the document requests heavy processing and gets it. 

Try the document in other readers, e.g. PDF.js/Firefox, performance is same or worse than with Okular/poppler. Only Adobe renders the document considerably faster, seemingly they have some optimization.

Albert, CCed you because I think you're familiar with the shading stuff in poppler, how would you suggest to continue here?
Comment 4 Albert Astals Cid 2020-02-09 23:17:30 UTC
I mean it's totally not an okular bug but a "this document is crazy" bug, if it could be improved somewhere would be in poppler, so yes this should be closed and a poppler bug opened to see if it can be somehow solved by caching or similar.