<html>
    <head>
      <base href="https://bugs.documentfoundation.org/">
    </head>
    <body><span class="vcard"><a class="email" href="mailto:baron@caesar.elte.hu" title="Aron Budea <baron@caesar.elte.hu>"> <span class="fn">Aron Budea</span></a>
</span> changed
          <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - FILESAVE: FILEOPEN: Abnormally long open & save times, thought to arise from conditional formatting in spreadsheet"
   href="https://bugs.documentfoundation.org/show_bug.cgi?id=115488">bug 115488</a>
          <br>
             <table border="1" cellspacing="0" cellpadding="8">
          <tr>
            <th>What</th>
            <th>Removed</th>
            <th>Added</th>
          </tr>

         <tr>
           <td style="text-align:right;">Version</td>
           <td>3.3.0 release
           </td>
           <td>Inherited From OOo
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">Blocks</td>
           <td>
                
           </td>
           <td>87351
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">OS</td>
           <td>Mac OS X (All)
           </td>
           <td>All
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - FILESAVE: FILEOPEN: Abnormally long open & save times, thought to arise from conditional formatting in spreadsheet"
   href="https://bugs.documentfoundation.org/show_bug.cgi?id=115488#c6">Comment # 6</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - FILESAVE: FILEOPEN: Abnormally long open & save times, thought to arise from conditional formatting in spreadsheet"
   href="https://bugs.documentfoundation.org/show_bug.cgi?id=115488">bug 115488</a>
              from <span class="vcard"><a class="email" href="mailto:baron@caesar.elte.hu" title="Aron Budea <baron@caesar.elte.hu>"> <span class="fn">Aron Budea</span></a>
</span></b>
        <pre>This issue is not specific to macOS.

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

<a href="https://opengrok.libreoffice.org/xref/core/sc/source/core/data/conditio.cxx#2046">https://opengrok.libreoffice.org/xref/core/sc/source/core/data/conditio.cxx#2046</a>
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.</pre>
        </div>
      </p>

        <div id="referenced">
          <hr style="border: 1px dashed #969696">
          <b>Referenced Bugs:</b>
          <ul>
              <li>
                [<a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [META] Conditional formatting bugs and enhancements"
   href="https://bugs.documentfoundation.org/show_bug.cgi?id=87351">Bug 87351</a>] [META] Conditional formatting bugs and enhancements
              </li>
          </ul>
        </div>
        <br>

      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>