diff options
author | Tor Lillqvist <tml@collabora.com> | 2017-10-04 12:40:20 +0300 |
---|---|---|
committer | Dennis Francis <dennis.francis@collabora.co.uk> | 2017-11-21 16:09:42 +0530 |
commit | 5222910f969390c64c18866834d9af53e7c4c189 (patch) | |
tree | 51b5104ddb0a1bde71cccd99b0e97584e4b0e536 /sc | |
parent | fd9d991ec02c3df178220031be6bd8b38c6c2c23 (diff) |
Make threaded calculation the default (when OpenCL is not used)
Introduce a configuration setting to turn it off. For now, can also be
turned off with the environment variable SC_NO_THREADED_CALCULATION,
but that is probably not something we want to keep or guarantee
staility of. (LO looks at way too many environment variables already.)
Change-Id: I469cde259eda72cc2d630814a25f707f1210b0ab
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/data/formulacell.cxx | 8 | ||||
-rw-r--r-- | sc/source/core/tool/token.cxx | 5 |
2 files changed, 7 insertions, 6 deletions
diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx index fed52b93ddec..615fbb8056f7 100644 --- a/sc/source/core/data/formulacell.cxx +++ b/sc/source/core/data/formulacell.cxx @@ -54,6 +54,7 @@ #include <svl/intitem.hxx> #include <o3tl/make_unique.hxx> #include <rtl/strbuf.hxx> +#include <officecfg/Office/Calc.hxx> #include <formulagroup.hxx> #include <listenercontext.hxx> #include <types.hxx> @@ -4322,11 +4323,10 @@ bool ScFormulaCell::InterpretFormulaGroup() return false; } - static const bool bThreadingRequested = std::getenv("CPU_THREADED_CALCULATION"); + static const bool bThreadingProhibited = std::getenv("SC_NO_THREADED_CALCULATION"); // To temporarilu use threading for sc unit tests regardless of the size of the formula group, - // add the condition !std::getenv("LO_TESTNAME") below (with &&), and run with - // CPU_THREADED_CALCULATION=yes + // add the condition !std::getenv("LO_TESTNAME") below (with &&) if (GetWeight() < ScInterpreter::GetGlobalConfig().mnOpenCLMinimumFormulaGroupSize) { mxGroup->meCalcState = sc::GroupCalcDisabled; @@ -4341,7 +4341,7 @@ bool ScFormulaCell::InterpretFormulaGroup() return false; } - if (!ScCalcConfig::isOpenCLEnabled() && bThreadingRequested) + if (!bThreadingProhibited && !ScCalcConfig::isOpenCLEnabled() && officecfg::Office::Calc::Formula::Calculation::UseThreadedCalculationForFormulaGroups::get()) { // iterate over code in the formula ... // ensure all input is pre-calculated - diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx index 0a586073c7c6..a24f41949022 100644 --- a/sc/source/core/tool/token.cxx +++ b/sc/source/core/tool/token.cxx @@ -25,6 +25,7 @@ #include <tools/mempool.hxx> #include <osl/diagnose.h> #include <sfx2/docfile.hxx> +#include <officecfg/Office/Calc.hxx> #include <token.hxx> #include <tokenarray.hxx> @@ -1346,11 +1347,11 @@ void ScTokenArray::CheckToken( const FormulaToken& r ) // It's already disabled. No more checking needed. return; - static const bool bThreadingRequested = std::getenv("CPU_THREADED_CALCULATION"); + static const bool bThreadingProhibited = std::getenv("SC_NO_THREADED_CALCULATION"); OpCode eOp = r.GetOpCode(); - if (!ScCalcConfig::isOpenCLEnabled() && bThreadingRequested) + if (!bThreadingProhibited && !ScCalcConfig::isOpenCLEnabled() && officecfg::Office::Calc::Formula::Calculation::UseThreadedCalculationForFormulaGroups::get()) { if (aThreadedCalcBlackList.count(eOp)) { |