diff options
author | Dennis Francis <dennis.francis@collabora.co.uk> | 2017-11-15 17:09:08 +0530 |
---|---|---|
committer | Dennis Francis <dennis.francis@collabora.co.uk> | 2017-11-21 16:09:43 +0530 |
commit | 9c88d6f2c9a1b03bc1f14684ceeceaf7e3e11bc5 (patch) | |
tree | c9fafaef11d7a1c81b553d4be4b8e5e273913ce5 /sc | |
parent | bc6a5d8e79e7d0e7d75ac107aa8e6aa275e434e9 (diff) |
halve thread count if HT active for group interpreter too
Change-Id: Iacc93122191152183127500a4172358a14e96c8b
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/data/formulacell.cxx | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx index 12cbd1493bee..e68325c59e0e 100644 --- a/sc/source/core/data/formulacell.cxx +++ b/sc/source/core/data/formulacell.cxx @@ -49,6 +49,7 @@ #include <tokenarray.hxx> #include <comphelper/threadpool.hxx> +#include <tools/cpuid.hxx> #include <formula/errorcodes.hxx> #include <formula/vectortoken.hxx> #include <svl/intitem.hxx> @@ -4360,6 +4361,8 @@ bool ScFormulaCell::InterpretFormulaGroup() return false; } + static bool bHyperThreadingActive = tools::cpuid::hasHyperThreading(); + // Then do the threaded calculation class Executor : public comphelper::ThreadTask @@ -4404,6 +4407,9 @@ bool ScFormulaCell::InterpretFormulaGroup() comphelper::ThreadPool& rThreadPool(comphelper::ThreadPool::getSharedOptimalPool()); sal_Int32 nThreadCount = rThreadPool.getWorkerCount(); + if ( bHyperThreadingActive && nThreadCount >= 2 ) + nThreadCount /= 2; + SAL_INFO("sc.threaded", "Running " << nThreadCount << " threads"); { |