[Libreoffice-bugs] [Bug 115488] FILESAVE: FILEOPEN: Abnormally long open & save times, thought to arise from conditional formatting in spreadsheet

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Mon Mar 12 02:17:38 UTC 2018


https://bugs.documentfoundation.org/show_bug.cgi?id=115488

Aron Budea <baron at caesar.elte.hu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|3.3.0 release               |Inherited From OOo
             Blocks|                            |87351
                 OS|Mac OS X (All)              |All

--- Comment #6 from Aron Budea <baron at caesar.elte.hu> ---
This issue is not specific to macOS.

Two problem areas are these functions:
https://opengrok.libreoffice.org/xref/core/sc/source/core/data/conditio.cxx#2270
sal_uInt32 ScConditionalFormatList::getMaxKey() const

https://opengrok.libreoffice.org/xref/core/sc/source/core/data/conditio.cxx#2046
ScConditionalFormat* ScConditionalFormatList::GetFormat( sal_uInt32 nKey )

They are both linear searches over m_ConditionalFormats, so with many
conditional format entries that can take a while.

What could be done? The comparison is done against the nKey coming from the
individual entries in m_ConditionalFormats (currently a set of pointers to
ScConditionalFormat objects).
One problem is that those nKey-s are set outside in the code, first by querying
an available one from the ScConditionalFormatList (that's what getMaxKey() is
for), setting it in the ScConditionalFormat, then adding it to the list, ie. in
'sal_uLong ScTable::AddCondFormat(...)', 'void
ScTable::CopyConditionalFormat(...)' and 'ScCondFormatDlg::OkPressed()'.

If managing nKey was internalized in ScConditionalFormatList, then it could
keep track of the max (making it a constant time operation), and keep the
conditional formats in a data structure sorted by nKey (making searching on
nKey logarithmic).

I'm not familiar with the code, so I can't tell if anything else could prevent
this change.


Referenced Bugs:

https://bugs.documentfoundation.org/show_bug.cgi?id=87351
[Bug 87351] [META] Conditional formatting bugs and enhancements
-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20180312/ca56492f/attachment-0001.html>


More information about the Libreoffice-bugs mailing list