Bug 115474 - Applying autoformat to a large number of cells takes too long (with row-alternate shading)
Summary: Applying autoformat to a large number of cells takes too long (with row-alter...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:25.2.0
Keywords: perf
Depends on:
Blocks: Table-AutoFormat
  Show dependency treegraph
 
Reported: 2018-02-05 17:02 UTC by Heiko Tietze
Modified: 2024-07-30 04:24 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Heiko Tietze 2018-02-05 17:02:55 UTC
Select columns A:E and apply any Format > Autoformat styles... Killed the process after an hour.

While the use case is to select only a small number of cells and to apply the style to this selection it's not unexpected that users try it for whole columns. A warning before the execution of potentially long lasting operation could be a solution. Or to disable the function in case of selection beyond a reasonable number.
Comment 1 Aron Budea 2018-02-06 01:21:36 UTC Comment hidden (obsolete)
Comment 2 Aron Budea 2018-02-06 01:40:20 UTC
Correction: it depends on if the style has row-alternate shading, eg. Box List Blue (6.0) or Currency Turqoise (< 6.0).
When using the appropriate style, the bug occurs from 6.0.0.3 all the way back to 3.3.0.
Comment 3 QA Administrators 2019-04-01 03:24:48 UTC Comment hidden (obsolete, spam)
Comment 4 Justin L 2020-07-04 16:46:12 UTC
Yup. It runs through left column, right column, top, bottom, body for 1 million rows.

#9  ScTable::AutoFormatArea(short, int, short, int, ScPatternAttr const&, unsigned short) (this=0x55555665e000, nStartCol=3, nStartRow=222882, nEndCol=3, nEndRow=222882, rAttr=..., nFormatNo=5)
    at sc/source/core/data/table4.cxx:2057

#10 ScTable::AutoFormat(short, int, short, int, unsigned short) (this=0x55555665e000, nStartCol=3, nStartRow=0, nEndCol=6, nEndRow=1048575, nFormatNo=5)
    at sc/source/core/data/table4.cxx:2092

#11 ScDocument::AutoFormat(short, int, short, int, unsigned short, ScMarkData const&) (this=0x55555703e510, nStartCol=3, nStartRow=0, nEndCol=6, nEndRow=1048575, nFormatNo=5, rMark=...)
    at sc/source/core/data/documen3.cxx:1172
Comment 5 Buovjaga 2021-05-03 11:04:47 UTC Comment hidden (obsolete)
Comment 6 QA Administrators 2023-05-04 03:21:53 UTC Comment hidden (obsolete)
Comment 7 libruser 2024-04-06 16:39:12 UTC
Version: 24.2.2.2 (X86_64) / LibreOffice Community
Build ID: d56cc158d8a96260b836f100ef4b4ef25d6f1a01
CPU threads: 8; OS: macOS 11.7.1; UI render: Skia/Metal; VCL: osx
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded

in 24.2.2.2 (X86_64) / LibreOffice Community 
columns A-E take long, but format succeeds.


Bug marked duplicate 124341 may not be a duplicate. "Selecting only part of the document works as intended."

#124341 still fails. Difference in repro steps is "select all", instead of Columns A-E. This implies that the code is now more efficient, but not scalable to the default number of cells.
Comment 8 Commit Notification 2024-07-28 21:07:22 UTC
Thorsten Behrens committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/46f7dcc5f499892ef093147b3f739c258bbf6b81

related tdf#115474: improve warning msg for slow autoformat

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 9 Mike Kaganski 2024-07-29 06:14:42 UTC
Possibly something like commit 15fd6de056a1389702a1d3be9ffd3fdd5a0795de could help here (unless that commit already applies? I haven't debugged).
Comment 10 Mike Kaganski 2024-07-30 04:20:44 UTC
(In reply to Commit Notification from comment #8)
> Thorsten Behrens committed a patch related to this issue.
> It has been pushed to "master":
> 
> related tdf#115474: improve warning msg for slow autoformat

FTR: commit 52b95cfbb0aba120229f9f92570f2aa6f1fe3e33 added the initial message to autoformat, that the commit above has improved.
Comment 11 Mike Kaganski 2024-07-30 04:24:28 UTC
(In reply to libruser from comment #7)
> Bug marked duplicate 124341 may not be a duplicate. "Selecting only part of
> the document works as intended."
> 
> #124341 still fails. Difference in repro steps is "select all", instead of
> Columns A-E. This implies that the code is now more efficient, but not
> scalable to the default number of cells.

I kind of agree. While both have the same root cause, there are specifics that allow to have some special-casing in whole sheet case (or more specifically, whole rows case), which wouldn't affect e.g. whole-columns (not whole-sheet) case.

Let me unduplicate.