[Libreoffice-commits] core.git: Branch 'libreoffice-6-3' - sc/source
Noel Grandin (via logerrit)
logerrit at kemper.freedesktop.org
Tue Jun 4 11:15:37 UTC 2019
sc/source/core/data/compressedarray.cxx | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
New commits:
commit cabaadf278ba099c53ed2b7a32f1e11bc632ad3a
Author: Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Mon Jun 3 16:52:02 2019 +0200
Commit: Xisco FaulĂ <xiscofauli at libreoffice.org>
CommitDate: Tue Jun 4 13:15:01 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>
(cherry picked from commit 79927a934b8a27bd4dee7a263171981e6ca22f8a)
Reviewed-on: https://gerrit.libreoffice.org/73433
Reviewed-by: Xisco FaulĂ <xiscofauli at libreoffice.org>
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