[Libreoffice-commits] core.git: sc/source

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Tue Jun 4 07:23:34 UTC 2019


 sc/source/core/data/compressedarray.cxx |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

New commits:
commit 79927a934b8a27bd4dee7a263171981e6ca22f8a
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Mon Jun 3 16:52:02 2019 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Tue Jun 4 09:22:57 2019 +0200

    tdf#121094 Opening xlxs with many rows takes several minutes
    
    Use a more useful expansion strategy when re-sizing the array, we use
    this 150% in a lot of other places.
    
    This takes the opening time from more than 4m (I lost patience) to under
    5s.
    
    Change-Id: I8511662947d737c26ec49503a75af8d4cf447f67
    Reviewed-on: https://gerrit.libreoffice.org/73394
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/sc/source/core/data/compressedarray.cxx b/sc/source/core/data/compressedarray.cxx
index f02956b6a27d..2016478d9194 100644
--- a/sc/source/core/data/compressedarray.cxx
+++ b/sc/source/core/data/compressedarray.cxx
@@ -20,8 +20,6 @@
 #include <compressedarray.hxx>
 #include <global.hxx>
 
-static const size_t nScCompressedArrayDelta = 4;
-
 template< typename A, typename D >
 ScCompressedArray<A,D>::ScCompressedArray( A nMaxAccessP, const D& rValue )
     : nCount(1)
@@ -84,7 +82,7 @@ void ScCompressedArray<A,D>::SetValue( A nStart, A nEnd, const D& rValue )
             size_t nNeeded = nCount + 2;
             if (nLimit < nNeeded)
             {
-                nLimit += nScCompressedArrayDelta;
+                nLimit *= 1.5;
                 if (nLimit < nNeeded)
                     nLimit = nNeeded;
                 std::unique_ptr<DataEntry[]> pNewData(new DataEntry[nLimit]);


More information about the Libreoffice-commits mailing list