Bug 135703 - EDITING Inserting paragraph before multi page table causes CPU spike
Summary: EDITING Inserting paragraph before multi page table causes CPU spike
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
5.3.0.3 release
Hardware: All All
: low minor
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: bibisected, bisected, haveBacktrace, perf, regression
Depends on:
Blocks: DOCX-Tables
  Show dependency treegraph
 
Reported: 2020-08-13 10:49 UTC by NISZ LibreOffice Team
Modified: 2023-06-02 10:09 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
Screenshot of the problem in Writer (65.07 KB, image/png)
2020-08-13 10:49 UTC, NISZ LibreOffice Team
Details
cannot reproduce the issue (123.71 KB, image/png)
2020-08-13 11:11 UTC, mattia.b89
Details
Perf flamegraph (125.63 KB, image/svg+xml)
2022-04-13 17:15 UTC, Buovjaga
Details
Perf flamegraph (203.91 KB, image/svg+xml)
2022-04-15 18:08 UTC, Buovjaga
Details

Note You need to log in before you can comment on or make changes to this bug.
Description NISZ LibreOffice Team 2020-08-13 10:49:49 UTC
Created attachment 164241 [details]
Screenshot of the problem in Writer

If I try to insert a new paragraph before the table in attachment #154864 [details] there is a small ~two seconds delay (on my old-ish laptop) with hourglass icon before the table layout is recalculated. Interestingly deleting the new paragraph and re-adding it is fast, but adding one more new is not.
In 6.4 and before this went much more smoothly.

Steps to reproduce:
    1. Open attachment #154864 [details] 
    2. Add a new paragraph before the table

Actual results:
Each new paragraph takes about two seconds on wait.

Expected results:
Instant result.

LibreOffice details:
Version: 7.1.0.0.alpha0+ (x64)
Build ID: <buildversion>
CPU threads: 4; OS: Windows 6.3 Build 9600; UI render: default; VCL: win
Locale: hu-HU (hu_HU); UI: hu-HU
Calc: CL

Also in:
Version: 7.0.0.3 (x64)
Build ID: 8061b3e9204bef6b321a21033174034a5e2ea88e
CPU szálak: 4; OS: Windows 6.3 Build 9600; Felületmegjelenítés: Skia/Raster; VCL: win
Locale: hu-HU (hu_HU); UI: hu-HU
Calc: CL

(in older versions several new paragraphs are need to be added to trigger the bug, also sometimes clicking into the table and out of it)

Verzió: 6.0.0.3
Build az.: 64a0f66915f38c6217de274f0aa8e15618924765
CPU szálak: 4; OS: Windows 6.3; Felületmegjelenítés: alapértelmezett; 
Területi beállítások: hu-HU (hu_HU); Calc: CL

Version: 5.3.0.3
Build ID: 7074905676c47b82bbcfbea1aeefc84afe1c50e1
CPU Threads: 4; OS Version: Windows 6.2; UI Render: GL; Layout Engine: new; 
Locale: en-US (hu_HU); Calc: CL

But not yet in:
Version: 5.2.0.4
Build ID: 066b007f5ebcc236395c7d282ba488bca6720265
CPU Threads: 4; OS Version: Windows 6.2; UI Render: GL; 
Locale: en-US (hu_HU)

Additional Information: 

Bibisected using bibisect-win32-5.3 to:
URL: https://cgit.freedesktop.org/libreoffice/core/commit/?id=8a800eea613c0f5ad3302136766791dc58880fb3
author	Mike Kaganski <mike.kaganski@collabora.com>	2016-12-08 23:01:03 +0300
committer	Andras Timar <andras.timar@collabora.com>	2016-12-12 20:24:29 +0000

tdf#104425 sw: split rows w/large min height (fix layout loop)

Before this it was possible to add so many empty paragraphs that pushed the table to the next page. With this about at the middle of the page several seconds of pause happens. Which is not exactly what happens today.
Comment 1 mattia.b89 2020-08-13 11:11:25 UTC
Can't reproduce it on Arch Linux w/
Version: 6.4.5.2
Build ID: 6.4.5-2
CPU threads: 4; OS: Linux 5.7; UI render: default; VCL: gtk3; 
Locale: it-IT (en_GB.UTF-8); UI-Language: en-GB
Calc: threaded

if I try to add a new paragraph (press Enter key)
LO adds new lines instantaneously without CPU spikes
BUT adding new lines do not move table that stays at the original position and new lines will be added in the background of the table

See screenshot
Comment 2 mattia.b89 2020-08-13 11:11:55 UTC
Created attachment 164245 [details]
cannot reproduce the issue
Comment 3 Buovjaga 2022-04-13 17:15:51 UTC
Created attachment 179538 [details]
Perf flamegraph

Took a perf trace of a single new line.
It's still slow.

Version: 7.4.0.0.alpha0+ / LibreOffice Community
Build ID: 2f2df626117380427d2e5e8417316f52823f1e6f
CPU threads: 8; OS: Linux 5.17; UI render: default; VCL: kf5 (cairo+xcb)
Locale: fi-FI (fi_FI.UTF-8); UI: en-US
Calc: threaded
Comment 4 Buovjaga 2022-04-15 18:08:34 UTC
Created attachment 179592 [details]
Perf flamegraph

I might have absentmindedly used some incorrect version for testing, so uploading a trace taken with an --enable-symbols build

Version: 7.4.0.0.alpha0+ / LibreOffice Community
Build ID: b2b821715a3745718a941fa99dda92137c0f0c86
CPU threads: 8; OS: Linux 5.17; UI render: default; VCL: kf5 (cairo+xcb)
Locale: fi-FI (fi_FI.UTF-8); UI: en-US
Calc: threaded