summaryrefslogtreecommitdiff
path: root/sc/source/core/data/documen2.cxx
diff options
context:
space:
mode:
authorDennis Francis <dennis.francis@collabora.co.uk>2018-11-08 12:23:00 +0530
committerDennis Francis <dennis.francis@collabora.com>2018-11-15 09:28:24 +0100
commit4ddd6f329163cbac5ff31e51a5b028d8eeedadd2 (patch)
tree61b145e2c032ec6ee1baab92b28d76b24faae4f1 /sc/source/core/data/documen2.cxx
parent10d497f9cc03e55c0e7119449e119606c40c563e (diff)
Cache the vConditions array...
used in ScInterpreter::IterateParameterIfs(). Store this cache as a member of ScInterpreterContext (maConditions). Create a static pool of ScInterpreterContext's so that the embedded maConditions is reused everytime a formula-group/ formula-cell is calculated. There needs to be two separate static pools - one for threading, one for non-threaded computation of formula-cells. With this, we can have better performance of the cached maConditions as well as mScLookupCache. In threaded case there is no recursive computation of cells as dependencies are all pre-computed. The thread-indexed lookup cache array in ScDocument is removed as now the lookup caches on context lives as long in the static context pools. This cached vConditions array can take advantage when there are lots of SUMIFS/COUNTIFS with arguments of similar dimensions in the document. Otherwise it will be allocated from scratch for every COUNTIFS/SUMIFS formula-cell. Change-Id: I654b05e55035ce6efcf07d32d36623c9d76b0ff6 Reviewed-on: https://gerrit.libreoffice.org/63066 Tested-by: Jenkins Reviewed-by: Dennis Francis <dennis.francis@collabora.com>
Diffstat (limited to 'sc/source/core/data/documen2.cxx')
-rw-r--r--sc/source/core/data/documen2.cxx5
1 files changed, 2 insertions, 3 deletions
diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx
index 9d8d8c5115bf..8ca890344a74 100644
--- a/sc/source/core/data/documen2.cxx
+++ b/sc/source/core/data/documen2.cxx
@@ -1163,9 +1163,8 @@ void ScDocument::ClearLookupCaches()
{
assert(!IsThreadedGroupCalcInProgress());
DELETEZ(GetNonThreadedContext().mScLookupCache);
- for( ScLookupCacheMap* cacheMap : mThreadStoredScLookupCaches )
- delete cacheMap;
- mThreadStoredScLookupCaches.clear();
+ // Clear lookup cache in all interpreter-contexts in the (threaded/non-threaded) pools.
+ ScInterpreterContextPool::ClearLookupCaches();
}
bool ScDocument::IsCellInChangeTrack(const ScAddress &cell,Color *pColCellBorder)