diff options
author | Noel Grandin <noel@peralex.com> | 2021-04-30 18:24:12 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-04-30 21:39:51 +0200 |
commit | deac5c84732c3491a0ef5bf7f8c1552e6def4fc0 (patch) | |
tree | 14d93b04f790c80695df11fb22a49fc3648700a7 /sc/source/filter/inc | |
parent | c926974ec1a4dbb72f273927fed0bc2f5e19c374 (diff) |
tdf#79049 speed up OOXML workbook load (2)
the allocation of memory and pointer chasing was
slowing things down in the styles conversion.
So switch to more cache-dense data structure,
and re-arrange the loops to be more cache friendly.
The takes the time from 1m9 to 40s for me.
Change-Id: I876580adc7823313b0cdb067f2f6b3e61c39ecf8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114941
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source/filter/inc')
-rw-r--r-- | sc/source/filter/inc/sheetdatabuffer.hxx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sc/source/filter/inc/sheetdatabuffer.hxx b/sc/source/filter/inc/sheetdatabuffer.hxx index c49e33280a10..17add16e6234 100644 --- a/sc/source/filter/inc/sheetdatabuffer.hxx +++ b/sc/source/filter/inc/sheetdatabuffer.hxx @@ -22,6 +22,7 @@ #include <vector> #include <map> #include <set> +#include <o3tl/sorted_vector.hxx> #include "richstring.hxx" #include "worksheethelper.hxx" @@ -165,7 +166,8 @@ private: /** Writes all cell formatting attributes to the passed cell range list. (depreciates writeXfIdRangeProperties) */ void applyCellMerging( const ScRange& rRange ); - void addColXfStyle( sal_Int32 nXfId, sal_Int32 nFormatId, const ScRange& rAddress, bool bProcessRowRange = false ); + void addColXfStyles(); + void addColXfStyleProcessRowRanges(); private: /** Stores cell range address and formula token array of an array formula. */ typedef std::pair< ScRange, ApiTokenSequence > ArrayFormula; @@ -200,7 +202,7 @@ private: return lhs.mnEndRow<rhs.mnStartRow; } }; - typedef ::std::set< RowRangeStyle, StyleRowRangeComp > RowStyles; + typedef ::o3tl::sorted_vector< RowRangeStyle, StyleRowRangeComp > RowStyles; typedef ::std::map< sal_Int32, RowStyles > ColStyles; /** Stores information about a merged cell range. */ struct MergedRange |