Bug 54349 - Conditional formatting - Duplication: UI slows down depending on size of used range
Summary: Conditional formatting - Duplication: UI slows down depending on size of used...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
3.6.0.2 rc
Hardware: All All
: medium enhancement
Assignee: Markus Mohrhard
URL:
Whiteboard: target:3.7.0 target:3.6.2
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-01 13:28 UTC by Geck0
Modified: 2012-09-21 13:54 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Sample file for bug#54349 (49.43 KB, application/vnd.oasis.opendocument.spreadsheet)
2012-09-01 20:59 UTC, Geck0
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Geck0 2012-09-01 13:28:10 UTC
Version 3.6.0.2 (Build ID: 360m1(Build:102)) - Ubuntu build
Looks calculation checks all cells not only those which contain values. Scrolling goes unusable slow if a whole column is used by the Conditional Formatting. If the range smaller, scrolling/UI reaction getting better.
Comment 1 Markus Mohrhard 2012-09-01 15:10:23 UTC
Can you please provide a test document showing the effect. The more serious the effect is with the test document the easier it will be to find the problem..
Thanks.
Comment 2 Geck0 2012-09-01 20:59:33 UTC
Created attachment 66463 [details]
Sample file for bug#54349
Comment 3 Geck0 2012-09-01 21:24:56 UTC
Hi Markus,

Please see sample file attached. This file has been created form a blank document. (The original was an Excel xlsx file.)
The first sheet (WholeColumn) contains cells with conditional formatting (CF). Those cells have a simple IF function. The second sheet (CF4OnlyData) contains the same but the CF is only set for the used range. The third (WholeColWithNumbers) sheet has a set CF for the whole column's range and containing cells with another simple function (=ROW()). This sheet refreshes even more slowly.

Please note if the functions in the cells are replaced to values, this issue doesn't happen. Also if I apply a function in CF instead of using this feature, everything works fine.

Many thanks for all your efforts.
Please let me know if I can help any further.

Kind regards,
 Gyorgy
Comment 4 Markus Mohrhard 2012-09-01 21:49:17 UTC
Ok, this is only a problem with duplicate, unique and color scales and data bars. These are related to the range of the conditional format entry and not only to the current cell.
Let me see if I can improve the performance for these cases. I might have an idea how I can speed them up a bit.
Comment 5 Markus Mohrhard 2012-09-02 16:14:32 UTC
Ok, so after looking closer at the source code and thinking a bit about all possible performance problems with conditional formats I decided to split this bug into two parts.

This bug here will be used for the cond format improvements that I will backport to 3.6. Bug 54396 will be used for the more radical algorithm change that I plan for 3.7
Comment 6 Markus Mohrhard 2012-09-16 01:57:18 UTC
Making this an EasyHack.

Changes to be done:

The current conditional format code evaluates for every cell the condition again. The right way is to cache the result for one paint run. So add a method in conditio.[ch]xx that signals the conditional formats that the cell data should be cached between these two calls for color scales, data bars and the unique and duplicate data. Then use these methods in fillinfo.cxx before and after the cell render information are collected.
Comment 7 Not Assigned 2012-09-18 12:50:43 UTC
Markus Mohrhard committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=2c933f90e3bc056b7094744d1512bd068dbf8d36

shrink to used area for duplicate codn format, fdo#54349



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 8 Not Assigned 2012-09-18 16:05:22 UTC
Markus Mohrhard committed a patch related to this issue.
It has been pushed to "libreoffice-3-6":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=e12546da1a88ecef130a3a6842820bc7ebb2a851&g=libreoffice-3-6

shrink to used area for duplicate codn format, fdo#54349


It will be available in LibreOffice 3.6.3.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 9 Markus Mohrhard 2012-09-19 19:07:51 UTC
Moved Easy Hack to the bug for 3.7

This one was never meant to be the easy hack.
Comment 10 Not Assigned 2012-09-21 13:49:42 UTC
Markus Mohrhard committed a patch related to this issue.
It has been pushed to "libreoffice-3-6-2":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=1d803422af63589699a3d78a506fd46a765e8a01&g=libreoffice-3-6-2

shrink to used area for duplicate codn format, fdo#54349


It will be available already in LibreOffice 3.6.2.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.