Bug 164218 - The time it takes to insert an image increases the further the image is inserted into the document
Summary: The time it takes to insert an image increases the further the image is inser...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.0.0.3 release
Hardware: x86-64 (AMD64) All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: bibisectRequest, perf, regression
Depends on:
Blocks: Writer-Header-Footer
  Show dependency treegraph
 
Reported: 2024-12-06 13:30 UTC by Lymperis Voudouris
Modified: 2024-12-06 19:59 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Long document with footer exhibiting the bug (1.13 MB, application/vnd.oasis.opendocument.text)
2024-12-06 17:20 UTC, Lymperis Voudouris
Details
Long document without footer (no bug) (1.13 MB, application/vnd.oasis.opendocument.text)
2024-12-06 17:20 UTC, Lymperis Voudouris
Details
video testing the bug (13.36 MB, video/webm)
2024-12-06 18:52 UTC, BogdanB
Details
Smaller, 551 pages file (508.79 KB, application/vnd.oasis.opendocument.text)
2024-12-06 19:31 UTC, Telesto
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lymperis Voudouris 2024-12-06 13:30:03 UTC
Description:
I have a 450 pages long document (.odt) with ~300 images. Inserting an image through the "Insert image" dialog became progressively slower as the document increased in size. What I've noticed is that the further into the the document I insert an image the more time it takes to finish insertion (showing "not responding" in the meantime). For example, inserting an image near the start of the document takes 1 second but inserting the same image at the end of the document can take up to 20 seconds. All images are SVG with file sizes in the tens of kilobytes.

After inserting an image, copying & pasting it around the document is very fast. The document itself once loaded is also very responsive. 

My workaround at the moment is to insert an image at the start of the document and then cut/paste at the desired location at the end of the document.

Unfortunately I can't share the document as the information contained is confidential


Steps to Reproduce:
- Open a large document with lots of images
- Insert an image at the end of the document
- Repeat insertion at the start of the document

Actual Results:
Image insertion time is much slower at the end of a large document compared to the start of the document

Expected Results:
Image insertion time should be consistent throughout the document and it shouldn't be as large as 20 seconds


Reproducible: Always


User Profile Reset: No

Additional Info:
Version: 24.8.0.3 (X86_64) / LibreOffice Community
Build ID: 0bdf1299c94fe897b119f97f3c613e9dca6be583
CPU threads: 12; OS: Linux 6.11; UI render: default; VCL: kf5 (cairo+wayland)
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded
Comment 1 BogdanB 2024-12-06 16:14:38 UTC
In order to help developers and testers to analyze your bug, you can create a new document, with some text copied and paste several times, and insert some images, multiple times... In order to simulate your document. If you reproduce the bug using this new created document, attach your document to this bug. This way is easier to get fixed.
Comment 2 Lymperis Voudouris 2024-12-06 17:20:09 UTC
Created attachment 197986 [details]
Long document with footer exhibiting the bug
Comment 3 Lymperis Voudouris 2024-12-06 17:20:41 UTC
Created attachment 197987 [details]
Long document without footer (no bug)
Comment 4 Lymperis Voudouris 2024-12-06 17:24:37 UTC
Ok, I've managed to create a document that exhibits the problem (first attachment). Inserting an image at the end of this document is very slow. Inserting an image at the start is fast. 

The problem seems to exist only when a footer is present and only after the file becomes big enough. Removing the footer fixes the problem (second attachment)
Comment 5 BogdanB 2024-12-06 18:52:36 UTC
Created attachment 197993 [details]
video testing the bug

Without inserting any image we can see the document is working on layout. See the video
Comment 6 BogdanB 2024-12-06 19:04:10 UTC
Documents summary: 1275 pages, 1237 tables, 1237 images, 1 section, 515.704 words, 3.484.566 characters
Comment 7 Telesto 2024-12-06 19:31:08 UTC
Created attachment 197994 [details]
Smaller, 551 pages file

(In reply to BogdanB from comment #6)
> Documents summary: 1275 pages, 1237 tables, 1237 images, 1 section, 515.704
> words, 3.484.566 characters

True, it takes a while to open. I created a trimmed down version, where I can still repro the described issue

1. Open the attached file
2. Go to the last page (551)
3. Insert -> Image -> Pick some (small) JPG image (100 KB or so) (3 seconds)
4. Drag and drop the same image from Desktop or File Browser to LibreOffice; Instant; no delay

Version: 25.2.0.0.alpha1+ (X86_64) / LibreOffice Community
Build ID: 94afced0195ef824e575176e33c79ca57484cd5c
CPU threads: 4; OS: Windows 8.1 X86_64 (6.3 build 9600); UI render: Skia/Raster; VCL: win
Locale: nl-NL (nl_NL); UI: en-US
Calc: CL threaded
Comment 8 Telesto 2024-12-06 19:39:07 UTC
Also in
Version: 7.6.3.0.0+ (X86_64) / LibreOffice Community
Build ID: 35f19e5cb93ce218787904e99c2bedfd40e725cc
CPU threads: 4; OS: Windows 6.3 Build 9600; UI render: Skia/Raster; VCL: win
Locale: nl-NL (nl_NL); UI: en-US
Calc: CL threaded

also in
Version: 7.0.7.0.0+ (x64)
Build ID: 626ea4e62a3e5005fe9825923a1c0c5bdb61cc08
CPU threads: 4; OS: Windows 6.3 Build 9600; UI render: default; VCL: win
Locale: nl-NL (nl_NL); UI: en-US
Calc: CL

fine with
Versie: 6.3.0.4 (x86)
Build ID: 057fc023c990d676a43019934386b85b21a9ee99
CPU-threads: 4; Besturingssysteem: Windows 6.3; UI-render: GL; VCL: win; 
Locale: nl-NL (nl_NL); UI-taal: nl-NL
Calc: CL
Comment 9 Telesto 2024-12-06 19:59:28 UTC
FWIW: while investigating the issue (comment 8) I also noticed that the page counter isn't updated as frequently as in the past (bug 164224)