Bug 94380 - Searching target in a PDF document to do a hyperlink is very slow
Summary: Searching target in a PDF document to do a hyperlink is very slow
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
5.0.1.2 release
Hardware: x86-64 (AMD64) All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: haveBacktrace, perf
Depends on:
Blocks: PDF-Export Hyperlink
  Show dependency treegraph
 
Reported: 2015-09-20 13:51 UTC by Rpnpif
Modified: 2023-09-12 08:10 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
PDF file for link target (7.23 MB, application/pdf)
2021-09-02 20:08 UTC, Buovjaga
Details
Perf flamegraph (309.33 KB, image/svg+xml)
2021-09-02 20:09 UTC, Buovjaga
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rpnpif 2015-09-20 13:51:36 UTC
To create a hyperlink, if the target document has a PDF type without summary, LO start a dead loop with 100% charge of the CPU.

To reproduce :

1. Download the file : http://eduscol.education.fr/sti/sites/eduscol.education.fr.sti/files/ressources/techniques/4808/4808-think-grid-10-en.pdf.

2. Open Writer and insert a hyperlink on the document 4808-think-grid-10-en.pdf.
In the dialogue box, choose a Target in Document.

3. LO start a high load activity with never stop.

Expected :
If there are none summary in the target PDF document, LO should say that.
Comment 1 Buovjaga 2015-09-20 17:43:17 UTC
Repro.

Win 7 Pro 64-bit, Version: 5.0.1.2 (32-bit)
Build ID: 81898c9f5c0d43f3473ba111d7b351050be20261
Locale: fi-FI (fi_FI)
Comment 2 Rpnpif 2015-12-27 11:25:38 UTC
With Version: 5.1.0.1 Build ID: bcace328aabc4c8c10b56daa87da0a2ee6579b5a, on AMD A4-5300 APU and Debian 8.2 (amd64), this issue is still present but after about 3 minutes, the hyperlink can be created.

Also, when I open the PDF document in LO, the operation takes at least 3 minutes, but now the operation is completed.
Also, the quality of the conversion of this PDF is very bad with a great mix of the layouts.

I conclude that the bad performance of the conversion of this PDF is the cause of this issue.
Comment 3 QA Administrators 2017-01-03 19:55:41 UTC Comment hidden (obsolete)
Comment 4 Rpnpif 2017-01-04 16:59:32 UTC
With the 5.2.4 release, the issue is partially fixed.

Now, the hyperlink is created in about one minute.
But several actions during the creation takes one minute for each. So the issue is now a performance issue.

I get a hyperlink as file:///tmp/4808-think-grid-10-en.pdf#Diapo 5, for example.

I saw another issue : clicking on this link open the PDF file but not on the Diapo 5.
Comment 5 QA Administrators 2018-08-22 02:37:43 UTC Comment hidden (obsolete)
Comment 6 Rpnpif 2018-08-23 10:26:12 UTC
This bug is still present in Version: 6.1.0.3
Build ID: efb621ed25068d70781dc026f7e9c5187a4decd1
Threads CPU : 2; OS : Linux 4.9; UI Render : par défaut; VCL: gtk2; 
Locale : fr-FR (fr_FR.utf8); Calc: group threaded
Comment 7 QA Administrators 2019-09-02 09:21:47 UTC Comment hidden (obsolete)
Comment 8 QA Administrators 2021-09-02 03:53:16 UTC Comment hidden (obsolete)
Comment 9 Rpnpif 2021-09-02 18:03:00 UTC
Last try with LO Version: 7.0.4.2
Build ID: 00(Build:2)
CPU threads: 4; OS: Linux 5.10; UI render: default; VCL: gtk3
Locale: fr-FR (fr_FR.UTF-8); Langue IHM : fr-FR
Debian package version: 1:7.0.4_rc2-1~bpo10+2
Calc: threaded

Result:
Same issue.

I noted that this issue can be reproduced when simply I opened directly this file in LO. The operation of opening ever failed in an infinite loop.
So I think that the initial report of this issue do an opening of the file.
Comment 10 Buovjaga 2021-09-02 20:08:05 UTC
Created attachment 174746 [details]
PDF file for link target

Let's attach it so it doesn't get lost
Comment 11 Buovjaga 2021-09-02 20:09:20 UTC
Created attachment 174747 [details]
Perf flamegraph

Lots of time spent in SfxBroadcaster at least

Version: 7.3.0.0.alpha0+ / LibreOffice Community
Build ID: eae0636311d3a1b3a1af58a3e4df686b55afa3fa
CPU threads: 8; OS: Linux 5.13; UI render: default; VCL: kf5 (cairo+xcb)
Locale: fi-FI (fi_FI.UTF-8); UI: en-US
Calc: threaded
Comment 12 Buovjaga 2021-09-02 20:10:30 UTC
The perf trace was taken with the original steps of starting to create a hyperlink
Comment 13 QA Administrators 2023-09-03 03:16:08 UTC Comment hidden (obsolete)
Comment 14 Rpnpif 2023-09-12 07:53:16 UTC
Hello,

I think that this issue was fixed at least partially. My tests with LO 7.4.7-1~bpo11+1 from Debian give me acceptable duration (one or two minutes) but long.

I see that the occupied memory has about a 1GB or more size that seems big to me but not worrying.

Regards.
Comment 15 Buovjaga 2023-09-12 08:10:04 UTC
(In reply to Rpnpif from comment #14)
> Hello,
> 
> I think that this issue was fixed at least partially. My tests with LO
> 7.4.7-1~bpo11+1 from Debian give me acceptable duration (one or two minutes)
> but long.
> 
> I see that the occupied memory has about a 1GB or more size that seems big
> to me but not worrying.

For me with an Intel i7 desktop computer from 2016 it took about 10 seconds, so seems acceptable.

Arch Linux 64-bit, X11
Version: 7.6.0.3 (X86_64) / LibreOffice Community
Build ID: 60(Build:3)
CPU threads: 8; OS: Linux 6.4; UI render: default; VCL: kf5 (cairo+xcb)
Locale: fi-FI (fi_FI.UTF-8); UI: en-US
7.6.0-2
Calc: threaded