Bug 133411 - Replacing lots of cell styles consumes too much memory/CPU
Summary: Replacing lots of cell styles consumes too much memory/CPU
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
6.3.0.4 release
Hardware: All All
: medium normal
Assignee: Caolán McNamara
URL:
Whiteboard: target:7.1.0 target:7.0.0.1 target:6.4.5
Keywords: bibisected, bisected, needUITest, perf, regression
Depends on:
Blocks:
 
Reported: 2020-05-26 15:38 UTC by NISZ LibreOffice Team
Modified: 2020-06-16 15:48 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Example file from Excel (2.18 MB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2020-05-26 15:38 UTC, NISZ LibreOffice Team
Details
Screenshot of the problem in Calc (113.89 KB, image/png)
2020-05-26 15:39 UTC, NISZ LibreOffice Team
Details

Note You need to log in before you can comment on or make changes to this bug.
Description NISZ LibreOffice Team 2020-05-26 15:38:10 UTC
Created attachment 161303 [details]
Example file from Excel

Attached document is containing a lot of cells (78 columns x 10000 rows) formatted with a cell style.
Using the replace functionality to change the style causes huge CPU and memory use.

Steps to reproduce:
    1. Open attached document
    2. Open the Find  and Replace dialog
    3. Select the Cell Styles checkbox
    4. Search for the Excel Built-in Accent2 style and Replace it with the Default style.
    5. Push the “Replace All” button, close the Results dialog and push “Replace All” again.

Actual results:
CPU use goes to 100% for quite a while, LO “does not respond”. Memory use grows quickly to about 3.5GB, then the replace is successfully done. Closing the document also takes a lot of CPU time.

Expected results:
Smooth user experience: before the bibisected change this replace happened in ~1 second.

LibreOffice details:
Version: 7.0.0.0.alpha1+ (x64)
Build ID: fd238380ae7820f12ac1f7c52d0f7180a93f3ba3
CPU threads: 4; OS: Windows 6.3 Build 9600; UI render: Skia/Raster; VCL: win
Locale: hu-HU (hu_HU); UI: en-US
Calc: CL

Also happens in:
Verzió: 6.3.0.4 (x86)
Build az.: 057fc023c990d676a43019934386b85b21a9ee99
CPU szálak: 4; OS: Windows 6.3; Felületmegjelenítés: alapértelmezett; VCL: win; 
Területi beállítások: hu-HU (hu_HU); Felület nyelve: hu-HU
Calc: CL

But not in:
Verzió: 6.2.0.3
Build az.: 98c6a8a1c6c7b144ce3cc729e34964b47ce25d62
CPU szálak: 4; OS: Windows 6.3; Felületmegjelenítés: GL; VCL: win; 
Területi beállítások: hu-HU (hu_HU); UI nyelve: hu-HU
Calc: threaded


Bibisected using bibisect-win32-6.3 to:
URL: https://cgit.freedesktop.org/libreoffice/core/commit/?id=f920e86fbf3968104e1dfc0e9934e80652ed0837 
author	Caolán McNamara <caolanm@redhat.com>	2019-03-22 15:59:00 +0000
committer	Caolán McNamara <caolanm@redhat.com>	2019-03-24 18:19:29 +0100

weld SvxSearchDialog

Adding CC to: Caolán McNamara
Comment 1 NISZ LibreOffice Team 2020-05-26 15:39:06 UTC
Created attachment 161304 [details]
Screenshot of the problem in Calc
Comment 2 Caolán McNamara 2020-05-27 14:20:51 UTC
its presumably a big accessibility relation, something that would only happen in past with a11y explicitly enabled vs always now
Comment 3 Commit Notification 2020-05-28 07:52:43 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/13769dea65137fc3c537de6257d15cb87b51f8ae

Related: tdf#133411 SetDocWin is using the previous search success state

It will be available in 7.1.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 4 Commit Notification 2020-05-28 07:54:06 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

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

Resolves: tdf#133411 drop CONTENT_FLOWS_TO from dialog to search results

It will be available in 7.1.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 5 Commit Notification 2020-05-28 10:10:36 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-7-0":

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

Related: tdf#133411 SetDocWin is using the previous search success state

It will be available in 7.0.0.1.

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 6 Commit Notification 2020-05-28 12:41:04 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-7-0":

https://git.libreoffice.org/core/commit/51b40687d41aab9576dd4e2620c3cd5231732d58

Resolves: tdf#133411 drop CONTENT_FLOWS_TO from dialog to search results

It will be available in 7.0.0.1.

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 7 Caolán McNamara 2020-05-28 13:29:49 UTC
this drops this a11y feature, it never really worked right. fixed in master, 7-0 and backport is in gerrit for 6-4
Comment 8 Xisco Faulí 2020-06-01 13:44:39 UTC
Super fast replacement in

Version: 7.0.0.0.beta1+
Build ID: 2506d8221dd940dfd93d3d7c183430ba6ba3089d
CPU threads: 4; OS: Linux 4.19; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded

@Caolán, thanks for fixing this issue!!
Comment 9 Commit Notification 2020-06-01 13:47:44 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-6-4":

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

Resolves: tdf#133411 drop CONTENT_FLOWS_TO from dialog to search results

It will be available in 6.4.5.

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.