Bug 75826 - Conditional Formats using STYLE(...) suck cpu when doing "nothing"
Summary: Conditional Formats using STYLE(...) suck cpu when doing "nothing"
Status: RESOLVED DUPLICATE of bug 95233
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
4.2.1.1 release
Hardware: x86-64 (AMD64) Linux (All)
: high major
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
: 54920 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-03-06 08:27 UTC by Jim Avera
Modified: 2016-03-28 17:26 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
.ods spreadsheet which burns 80% CPU when "idle" (113.53 KB, application/x-vnd.oasis.opendocument.spreadsheet)
2014-03-06 08:27 UTC, Jim Avera
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jim Avera 2014-03-06 08:27:35 UTC
Created attachment 95212 [details]
.ods spreadsheet which burns 80% CPU when "idle"

LO Calc uses 80% CPU or more when sitting "idle" if Conditional Formats are used in conjunction with STYLE(...).   I'm using this to style rows of data depending on a key value in one of the columns, while leading the other columns containing "plain data" the user can easliy change.

The load increases with the number of cond-formatted cells... it' as if some background thread continually re-evaluates all the Cond. Fmt formulas for all the cells even though no data is changing anywhere.

Attached is a demo .ods file.   It contains a VLOOKUP table in A1:B3 followed by a large array of sample data.  The data cells all have same conditional format with

   Formula: STYLE(VLOOKUP($A$1:$A$9999, $A$1:$B$3, 2, 0))

   (The "apply style" is irrrelevant because STYLE() always returns false)

Please try the attached demo.
Comment 1 Jim Avera 2014-03-06 08:29:26 UTC
Alright, would somebody please post how to attach a .ods document and have it not be stored as text.  The file type drop-downs don't offer any ODF formats as an option...
Comment 2 Joel Madero 2014-03-07 01:39:00 UTC
In the future "auto detect" will do it :)
Comment 3 Joel Madero 2014-03-07 01:57:42 UTC
Same behavior on 4.2.1.1 so updating version. I've asked Markus about this to see what he thinks - might be expected. 

Also for attachments - FDO has a bug where you can't auto detect the first attachment so apologies for that :)
Comment 4 Markus Mohrhard 2014-03-07 09:17:40 UTC
STYLE + Conditional Formatting is sadly a bad combination right now.

At some point I need to profile what is going wrong and fix it properly.
Comment 5 Joel Madero 2014-03-07 16:04:29 UTC
Thanks Markus - marking as NEW
Comment 6 QA Administrators 2015-06-08 14:41:55 UTC
** Please read this message in its entirety before responding **

To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year.

There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present.

If you have time, please do the following:

   Test to see if the bug is still present on a currently supported version of LibreOffice (4.4.3 or later)
   https://www.libreoffice.org/download/

   If the bug is present, please leave a comment that includes the version of LibreOffice and your operating system, and any changes you see in the bug behavior
 
 If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a short comment that includes your version of LibreOffice and Operating System

Please DO NOT

   Update the version field
   Reply via email (please reply directly on the bug tracker)
   Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not appropriate in this case)


If you want to do more to help you can test to see if your issue is a REGRESSION. To do so: 1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3)

http://downloadarchive.documentfoundation.org/libreoffice/old/

2. Test your bug 
3. Leave a comment with your results;
4a. If the bug was present with 3.3 - set version to "inherited from OOo"; 
4b. If the bug was not present in 3.3 - add "regression" to keyword


Feel free to come ask questions or to say hello in our QA chat: http://webchat.freenode.net/?channels=libreoffice-qa

Thank you for your help!

-- The LibreOffice QA Team This NEW Message was generated on: 2015-06-08
Comment 7 Jim Avera 2015-06-09 00:56:39 UTC
Tried 5.0.0.0.beta1+ and it still sucks CPU cycles just sitting idle.

"top" on Linux shows soffice.bin varying from 61% to 98%
Comment 8 m_a_riosv 2015-10-31 15:15:37 UTC
*** Bug 54920 has been marked as a duplicate of this bug. ***
Comment 9 Markus Mohrhard 2016-03-28 15:09:58 UTC
As explained in the other bug report I currently don't consider this behavior a bug and instead consider using STYLE inside of a conditional format function an user error (one that we can possibly avoid by causing a formula compilation error).

*** This bug has been marked as a duplicate of bug 95233 ***
Comment 10 Jim Avera 2016-03-28 17:26:33 UTC
Hi Marcus,

Would you please post more about why this is a user error (or unreasonable use)?
I read your comment#7 in bug 95233, but don't yet understand why STYLE() in a conditional format is inherently a problem.

You said "Now as STYLE changes the cell we of course need to recalculate the conditional format again"

... Yes, that would be true if the cell kept changing.  The problem is that
infinite re-calculation keeps happening even when the cell does NOT change
value, i.e., after all cells have reached the intended steady state.   That's
the bug as I understand it.

Thanks,

-Jim