Bug 152298 - FILEOPEN DOCX Copying and pasting between table cells is slow (steps in comment 7)
Summary: FILEOPEN DOCX Copying and pasting between table cells is slow (steps in comme...
Status: CLOSED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
5.4.0.3 release
Hardware: All All
: medium normal
Assignee: Mike Kaganski
URL:
Whiteboard: target:25.2.0 target:24.8.2 inRelease...
Keywords: bibisected, bisected, filter:docx, perf, regression
Depends on:
Blocks: Writer-Tables
  Show dependency treegraph
 
Reported: 2022-11-29 14:40 UTC by Piotr Osada
Modified: 2025-01-23 20:16 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Compilation (empty tab+empty content).docx (17.88 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2022-11-29 14:42 UTC, Piotr Osada
Details
Desktop recording of the document editing process (21.82 MB, video/webm)
2022-11-29 14:46 UTC, Piotr Osada
Details
Simplified working example DOCX (16.90 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2024-09-24 16:15 UTC, Piotr Osada
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Piotr Osada 2022-11-29 14:40:56 UTC
Description:
As it is shown in attached movie writer is hanging/suspending when we scroll to a table in attached document.

Original document have 12 MB and contains more than 50 images. Attached one is an template of original witch the same arrangement of sections, captions, and tables. The table contains example data the in the same order as in original document.

Steps to Reproduce:
In original document:
1) Open document,
2) scroll down to the table,
3) Writer hangs (I don't know for how long).

In compilation (attached template)
1) Open document,
2) do something (click on cells, select ranges, drag and drop content, and ESPECIALLY: COPY AND PASTE some ranges),
3) Writer hangs (for 30 seconds or even for 2 minutes). 

Actual Results:
On Windows Writer responds after about 30-120 s.
On Linux it seems to last longer (I didn't get an answer. At least after one minute). 

Expected Results:
As in MS Word, Writer should respond within milliseconds (less than one second at worst).


Reproducible: Always


User Profile Reset: No

Additional Info:
"Config 4" - laptop

Version: 7.4.2.3 (x64) / LibreOffice Community
Build ID: 382eef1f22670f7f4118c8c2dd222ec7ad009daf
CPU threads: 8; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: pl-PL (pl_PL); UI: en-US
Calc: threaded

CPU: Intel Core i7-8565U @ 1.80 GHz
RAM: 24 GB, DDR4, 2400 MHz
SSD: Samsung 980 PRO 2 TB (more than 60% of free space)
Comment 1 Piotr Osada 2022-11-29 14:42:52 UTC
Created attachment 183889 [details]
Compilation (empty tab+empty content).docx

Template of 12 MB original document that causes even more intensive hangs.
Comment 2 Piotr Osada 2022-11-29 14:46:54 UTC
Created attachment 183890 [details]
Desktop recording of the document editing process

The video shows program hang when editing the table. In the original document, the program crashed after scrolling to the table.
Comment 3 Robert Großkopf 2022-11-30 13:57:22 UTC
Done this with the attached document:
Opened the document, scrolled down, clicked in the table, scrolled up. Scrolling up hangs.
Save the document as *.odt
Closed document, opened it again and down the same as described above. Couldn't detect any buggy behavior with document in *.odt-format.

Tested with
Version: 7.4.3.2 / LibreOffice Community
Build ID: 1048a8393ae2eeec98dff31b5c133c5f1d08b890
CPU threads: 6; OS: Linux 5.3; UI render: default; VCL: kf5 (cairo+xcb)
Locale: de-DE (de_DE.UTF-8); UI: de-DE
Calc: threaded

under OpenSUSE 15.3

Changed the summary to show it is a special bug together with *.docx.
Comment 4 Buovjaga 2024-09-15 15:56:44 UTC
No hang for me, please re-test

Arch Linux 64-bit
Version: 25.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: fb39ae1bc7e4b1cbfc3108efca52ec310faf7363
CPU threads: 8; OS: Linux 6.10; UI render: default; VCL: kf6 (cairo+wayland)
Locale: fi-FI (fi_FI.UTF-8); UI: en-US
Calc: CL threaded
Built on 14 September 2024
Comment 5 Piotr Osada 2024-09-16 10:59:01 UTC
Tested cases:

1) -- Hangs when scroll down from top to bottom by scroll bar
2) -- Hangs when doubble click on link to table 'Wyniki w tabeli' in Navigator
3) -- Hangs when copy/cut 0,123 formatted content and paste into 1.09.2022 formatted cells:
	variations:
3.1) ---- when copy 2x1:
0,123
0,123
and paste in 2x1
1.09.2022
1.09.2022
it could hangs
3.1) ====> after displaying 0,123 values in 1.09.2022 cells
3.1) ====> or before displaying

3.2) ---- when copy 2x2:
0,123	0,123
0,123	0,123
and paste in 2x2 region:
0,123	1.09.2022
0,123	1.09.2022
3.2) ====> it hangs instantly


~~~
Version: 7.6.5.2 (X86_64) / LibreOffice Community
Build ID: 38d5f62f85355c192ef5f1dd47c5c0c0c6d6598b
CPU threads: 8; OS: Windows 10.0 Build 22631; UI render: Skia/Raster; VCL: win
Locale: pl-PL (pl_PL); UI: en-US
Calc: CL threaded

	DOCX		ODT
1) 	hangs 		ok (no hangs)
2) 	hangs 		ok
3) 	hangs 		ok


~~~
Version: 24.8.1.2 (X86_64) / LibreOffice Community
Build ID: 87fa9aec1a63e70835390b81c40bb8993f1d4ff6
CPU threads: 8; OS: Windows 11 X86_64 (10.0 build 22631); UI render: Skia/Vulkan; VCL: win
Locale: pl-PL (pl_PL); UI: en-US
Calc: CL threaded

	DOCX		ODT
1) 	ok 		ok
2) 	ok 		ok
3) 	hangs 		ok




~~~
Version: 25.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 47a348bb0fd6dfdd93c1975d216daadc4f6b9b6f
CPU threads: 8; OS: Windows 11 X86_64 (10.0 build 22631); UI render: Skia/Raster; VCL: win
Locale: pl-PL (pl_PL); UI: pl-PL
Calc: CL threaded

https://dev-builds.libreoffice.org/daily/master/current.html
build on:
Win-x86_64@tb77-TDF 	2024-09-13 04:00:04

	DOCX		ODT
1) 	ok 		ok
2) 	ok 		ok
3) 	hangs 		ok
Comment 6 Piotr Osada 2024-09-16 11:01:48 UTC
All tests from comment 5 on attachment 183889 [details].
Comment 7 Buovjaga 2024-09-16 12:17:48 UTC
Ok, I repro, but it's not hanging, it just takes several seconds to complete.

1. Open attachment 183889 [details]
2. Go to the second to last page
3. In the table, copy 0,123 from one of the cells and paste into a cell with 1.09.2022

Bibisected with linux-64-5.4 to 6f5024de2e1a5cc533527e45b33d9a415467c48d
tdf#104425 sw: split rows w/large min height (fix layout loop)
Comment 8 Mike Kaganski 2024-09-19 13:49:19 UTC
https://gerrit.libreoffice.org/c/core/+/173675
Comment 9 Commit Notification 2024-09-20 02:05:16 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/c1020d1ebb95615b68ffda0adf936f38fb2a06af

Related: tdf#152298 Consider bottom margin in remaining space calculation

It will be available in 25.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 10 Commit Notification 2024-09-20 02:06:20 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/f0baab027df46d4e74b7808ff5d976b8efb1ea33

tdf#152298: Handle "keep with next, allow split, span some rows" case

It will be available in 25.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 11 Buovjaga 2024-09-20 08:14:33 UTC
Verified, thanks

Arch Linux 64-bit
Version: 25.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: f0baab027df46d4e74b7808ff5d976b8efb1ea33
CPU threads: 8; OS: Linux 6.10; UI render: default; VCL: kf6 (cairo+wayland)
Locale: fi-FI (fi_FI.UTF-8); UI: en-US
Calc: CL threaded
Built on 20 September 2024
Comment 12 Commit Notification 2024-09-23 07:33:12 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "libreoffice-24-8":

https://git.libreoffice.org/core/commit/d1a4d4c7b44d45818169322ad61e3063cfcc1da1

Related: tdf#152298 Consider bottom margin in remaining space calculation

It will be available in 24.8.2.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 13 Commit Notification 2024-09-23 07:34:15 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "libreoffice-24-8":

https://git.libreoffice.org/core/commit/0a5fff7bb409db38088c79811f4280b9a41ee5e2

tdf#152298: Handle "keep with next, allow split, span some rows" case

It will be available in 24.8.2.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 14 Piotr Osada 2024-09-24 10:19:26 UTC
Confirm, performance of the described operation is significantly improved (operation like in comment 7, but with 3x3 range):



Column number
3	4	5

\\ copy 3x3:
0,123	0,123	0,123
0,123	0,123	0,123
0,123	0,123	0,123




6	7	8

\\ paste into region:
0,123	0,123	1.09.2022
0,123	0,123	1.09.2022
0,123	0,123	1.09.2022


\\ with version:
Version: 24.8.0.2 (X86_64) / LibreOffice Community
Build ID: 57ceca7d2eefdf83e7c9b4135a017f3361a8133f
CPU threads: 8; OS: Windows 11 X86_64 (10.0 build 22631); UI render: Skia/Raster; VCL: win
Locale: pl-PL (pl_PL); UI: en-US
Calc: CL threaded

\\ this takes (measured by stoper, since hitting Ctrl+V until the display the results on screen):
37 seconds (stoper)

\\ with version:
Version: 25.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 5f6cd97220fca3d00647a5a1641f2e3f8b9f3533
CPU threads: 8; OS: Windows 11 X86_64 (10.0 build 22631); UI render: Skia/Raster; VCL: win
Locale: pl-PL (pl_PL); UI: en-US
Calc: CL threaded
Built on 22 September 2024


\\ including these commits:
 fb39ae1bc7e4b1cbfc3108efca52ec310faf7363 Jim Raykowski Thu Sep 12 22:54:43 2024 c1020d1ebb95615b68ffda0adf936f38fb2a06af Mike Kaganski Wed Sep 18 13:01:44 2024 f0baab027df46d4e74b7808ff5d976b8efb1ea33 Mike Kaganski Wed Sep 18 18:07:25 2024
\\ operation takes:
0,1 -- 0,5 second (subiectively, somewhere in this range)



\\ win 11 task mgr:
Procesor CPU

	Intel(R) Core(TM) i7-4700MQ CPU @ 2.40GHz

	Szybkość podstawowa:	2,40 GHz
	Gniazda:	1
	Rdzenie:	4
	Procesory logiczne:	8
	Wirtualizacja:	Włączone
	Pamięć podręczna poziomu 1:	256 KB (cache L1)
	Pamięć podręczna poziomu 2:	1,0 MB
	Pamięć podręczna poziomu 3:	6,0 MB

	Procesy	242
	Wątki	3143
	Dojścia	118247


Pamięć

	16,0 GB DDR3

	Szybkość:	1600 MHz
	Użyte gniazda:	4 z 4
	Współczynnik postaci:	SODIMM
	Sprzętowa zarezerwowana:	75,9 MB

	Dostępna	5,8 GB
	Buforowana	3,1 GB
	Zadeklarowana	12,0/22,4 GB
	Pula stronicowana	1012 MB
	Pula niestronicowana	423 MB
	W użyciu (po kompresji)	10,0 GB (372 MB)


Dysk

	Samsung SSD 870 QVO 1TB

Thanks to Buovjaga testing this behavior after years, and to Mike Kaganski for solving this :-)
Comment 15 Piotr Osada 2024-09-24 16:15:00 UTC
Created attachment 196655 [details]
Simplified working example DOCX

SUMMARY OF BUG AND SOLUTION

When in DOCX all rows in table has 'Keep with next paragraph' paragraph setting (Format -> Paragraph -> Text Flow) and horizontally merged cells *** that are split int two pages, then some operations relating to this table could trigger some program loops mentioned in +++ comits +++ to handle styles in that table and this requires enormous computational power, and thus application hangs for a longer while.

***here in tdf#152298 simplified working example.docx: A38:A41
+++ fb39ae1bc7e4b1cbfc3108efca52ec310faf7363 Jim Raykowski Thu Sep 12 22:54:43 2024 c1020d1ebb95615b68ffda0adf936f38fb2a06af Mike Kaganski Wed Sep 18 13:01:44 2024 f0baab027df46d4e74b7808ff5d976b8efb1ea33 Mike Kaganski Wed Sep 18 18:07:25 2024


ONE ISSUE:
1) Put the cursor at the end of first paragraph.
2) Press enter.
3) Press delete.
4) Press arrow up (OR any arrow key to change cell: ← ↑ → ↓).


Actual result:
After step 2) second paragraph is added +table is moved to second page
After step 3) cursor is in the first cell of table
After step 4) program hangs for 20-40 seconds and after this time cursor is at the begining of the first paragraph

Expected result:
After step 2) second paragraph is added
After step 3) cursor is in the first cell of table
After step 4) cursor is at the begining of the first paragraph

ANOTHER ISSUE:
described in:
Comment 7
Comment 14


inReleaseNotes:24.8
https://wiki.documentfoundation.org/index.php?title=ReleaseNotes/24.8&oldid=771764
Comment 16 Gene Watts 2024-11-27 02:34:50 UTC Comment hidden (spam)
Comment 17 Samuel Odell 2025-01-02 18:42:49 UTC Comment hidden (spam)