Bug 158812 - Writer freezes for 40 seconds when pasting contents from a web page
Summary: Writer freezes for 40 seconds when pasting contents from a web page
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.6.4.1 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: perf
Depends on:
Blocks: HTML-Paste
  Show dependency treegraph
 
Reported: 2023-12-21 14:45 UTC by Stéphane Guillou (stragu)
Modified: 2024-04-11 19:50 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
VerySleepy Stack (2.37 KB, text/plain)
2024-04-11 19:49 UTC, Telesto
Details
Screencast (809.86 KB, image/gif)
2024-04-11 19:50 UTC, Telesto
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stéphane Guillou (stragu) 2023-12-21 14:45:31 UTC
Split from bug 158499.

Steps:
1. Go to the archived we page https://web.archive.org/web/20230519131719/https://www.census.gov/acs/www/about/why-we-ask-each-question/
2. Select everything with Ctrl + A, copy it
3. In Writer, paste

Result: frozen for about 40 seconds but contents eventually pasted.

Version: 24.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 29b11fa3b5574dc3f42f55b0716f71054030c6c2
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

Version: 7.6.4.1 (X86_64) / LibreOffice Community
Build ID: e19e193f88cd6c0525a17fb7a176ed8e6a3e2aa1
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded
Comment 1 Stéphane Guillou (stragu) 2023-12-21 14:46:07 UTC
Confirmed via bug 158499 comment 7.
Comment 2 m_a_riosv 2023-12-22 02:06:47 UTC
But the website seems heavy to load, at least 10 seconds on my computer.
Comment 3 Telesto 2024-04-11 19:49:51 UTC
Created attachment 193633 [details]
VerySleepy Stack

The web.archive.org is a good example of a 'slow' website (to be expected for an archive). Based on the stack it's more or less like bug 45307 comment 35. LibreOffice is trying to download the images files, until time-out hits.

Not sure if it's downloading in parallel or sequential. Or how many images can be requested at once (server side configuration)

The fun part. The document will scroll to bottom when paste finishes (normal). However, LibreOffice will try to fetch the missing images, which it failed to load on the initial paste if you scroll onto a page with missing images. Same happens also on file-open. It will try to fetch the missing images again (freeze). Surely nice to attempt to add the missing images.. but well there is a price 

---
* It might be that the the fetching of those images isn't run on a different thread in the background, or it is but somehow interacting with main thread causing freeze.
* There is no 'update link' dialog on file-open. Saying should I download the missing images, which can be slow. It simply attempts it. A 404 error is quick but available but with slow response times (ping) or very low data transfer speeds  
* Another observation: although the fetch might succeed on second, third, fourth, fifth attempt, those don't necessary show up in the document (screencast) for some reason.. Those do appear after save and reload (although not 100% sure, because it froze on file-open)
Comment 4 Telesto 2024-04-11 19:50:25 UTC
Created attachment 193634 [details]
Screencast