diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-06-03 16:52:02 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-06-04 09:22:57 +0200 |
commit | 79927a934b8a27bd4dee7a263171981e6ca22f8a (patch) | |
tree | 20bd926a143bcaa97c12a7e5a2bece2d1260eb28 /sc | |
parent | 22005041f829d85e675ea27bdee1770af58a1ea0 (diff) |
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@collabora.co.uk>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/data/compressedarray.cxx | 4 |
1 files changed, 1 insertions, 3 deletions
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]); |