Kaydet (Commit) 79927a93 authored tarafından Noel Grandin's avatar Noel Grandin

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

Change-Id: I8511662947d737c26ec49503a75af8d4cf447f67
Reviewed-on: https://gerrit.libreoffice.org/73394
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 22005041
......@@ -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]);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment