sc/inc/formularesult.hxx | 4 ++-- sc/source/core/tool/formularesult.cxx | 22 +++++++++++++++------- 2 files changed, 17 insertions(+), 9 deletions(-)
New commits: commit 69f279d7fd266c80584eb845291a6ba3df26631b Author: Dennis Francis <dennis.fran...@collabora.co.uk> AuthorDate: Thu Nov 8 09:42:04 2018 +0530 Commit: Dennis Francis <dennis.fran...@collabora.com> CommitDate: Mon Nov 12 06:11:47 2018 +0100 Re-order the members of ScFormulaResult... to make the common access pattern cache friendly. For example, in case of a large sum like =SUM(A1:A50000) where the column A itself is composed of formulas, the inner loop of computation involves accessing ScFormulaResult's of each formulacell of column A. Recently this was made faster by the use of a "cache" flag (commit 77f7b4768a), so to get the result it just need access to the cache bool-flag and the mfValue member. Hence it makes sense to group the bools together with the mfValue member. Change-Id: If12d0736ba98b9d74e7b96304fce71e8e6e66619 Reviewed-on: https://gerrit.libreoffice.org/63063 Tested-by: Jenkins Reviewed-by: Dennis Francis <dennis.fran...@collabora.com> diff --git a/sc/inc/formularesult.hxx b/sc/inc/formularesult.hxx index fea35eb49a31..d6e9293569ac 100644 --- a/sc/inc/formularesult.hxx +++ b/sc/inc/formularesult.hxx @@ -77,13 +77,13 @@ class ScFormulaResult double mfValue; // double result direct for performance and memory consumption const formula::FormulaToken* mpToken; // if not, result token obtained from interpreter }; - FormulaError mnError; // error code bool mbToken :1; // whether content of union is a token bool mbEmpty :1; // empty cell result bool mbEmptyDisplayedAsString :1; // only if mbEmpty - Multiline meMultiline :2; // result is multiline // If set it implies that the result is a simple double (in mfValue) and no error bool mbValueCached :1; + Multiline meMultiline :2; // result is multiline + FormulaError mnError; // error code /** Reset mnError, mbEmpty and mbEmptyDisplayedAsString to their defaults prior to assigning other types */ diff --git a/sc/source/core/tool/formularesult.cxx b/sc/source/core/tool/formularesult.cxx index 80d6ccfbc0f4..c81bb1e54d22 100644 --- a/sc/source/core/tool/formularesult.cxx +++ b/sc/source/core/tool/formularesult.cxx @@ -23,17 +23,21 @@ FormulaResultValue::FormulaResultValue( FormulaError nErr ) : meType(Error), mfV } ScFormulaResult::ScFormulaResult() : - mpToken(nullptr), mnError(FormulaError::NONE), mbToken(true), - mbEmpty(false), mbEmptyDisplayedAsString(false), + mpToken(nullptr), + mbToken(true), + mbEmpty(false), + mbEmptyDisplayedAsString(false), + mbValueCached(false), meMultiline(MULTILINE_UNKNOWN), - mbValueCached(false) {} + mnError(FormulaError::NONE) {} ScFormulaResult::ScFormulaResult( const ScFormulaResult & r ) : - mnError( r.mnError), mbToken( r.mbToken), + mbToken( r.mbToken), mbEmpty( r.mbEmpty), mbEmptyDisplayedAsString( r.mbEmptyDisplayedAsString), + mbValueCached( r.mbValueCached), meMultiline( r.meMultiline), - mbValueCached( r.mbValueCached) + mnError( r.mnError) { if (mbToken) { @@ -60,8 +64,12 @@ ScFormulaResult::ScFormulaResult( const ScFormulaResult & r ) : } ScFormulaResult::ScFormulaResult( const formula::FormulaToken* p ) : - mnError(FormulaError::NONE), mbToken(false), mbEmpty(false), mbEmptyDisplayedAsString(false), - meMultiline(MULTILINE_UNKNOWN), mbValueCached(false) + mbToken(false), + mbEmpty(false), + mbEmptyDisplayedAsString(false), + mbValueCached(false), + meMultiline(MULTILINE_UNKNOWN), + mnError(FormulaError::NONE) { SetToken( p); } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits