diff options
author | Dennis Francis <dennis.francis@collabora.com> | 2019-10-15 06:57:56 +0530 |
---|---|---|
committer | Dennis Francis <dennis.francis@collabora.com> | 2019-10-17 08:06:49 +0200 |
commit | 4ee424b3ddc6e483cac8bd76ddc0bcabe48241dc (patch) | |
tree | a552432da4728517cea4f0a11816545ebe178caa /sc/inc | |
parent | 30d803e83390d8a4f475522dc23bcd107f7fdc12 (diff) |
Pre-allocate an ScInterpreter object for each thread...
and reuse them for interpret'ing all cells under the
respective threads. This gives a sizeable win in the execution
time especially for long formula-groups.
Change-Id: Ib340950f21e863b5b821d20c092214d8bc5012aa
Reviewed-on: https://gerrit.libreoffice.org/80845
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'sc/inc')
-rw-r--r-- | sc/inc/interpretercontext.hxx | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sc/inc/interpretercontext.hxx b/sc/inc/interpretercontext.hxx index c7598fef8cdc..b46a23f4e6a0 100644 --- a/sc/inc/interpretercontext.hxx +++ b/sc/inc/interpretercontext.hxx @@ -24,6 +24,7 @@ class FormulaToken; class ScDocument; class SvNumberFormatter; struct ScLookupCacheMap; +class ScInterpreter; // SetNumberFormat() is not thread-safe, so calls to it need to be delayed to the main thread. struct DelayedSetNumberFormat @@ -45,12 +46,14 @@ struct ScInterpreterContext // Allocation cache for "aConditions" array in ScInterpreter::IterateParameterIfs() // This is populated/used only when formula-group threading is enabled. std::vector<sal_uInt32> maConditions; + ScInterpreter* pInterpreter; ScInterpreterContext(const ScDocument& rDoc, SvNumberFormatter* pFormatter) : mpDoc(&rDoc) , mnTokenCachePos(0) , maTokens(TOKEN_CACHE_SIZE, nullptr) , mScLookupCache(nullptr) + , pInterpreter(nullptr) , mpFormatter(pFormatter) { } |