summaryrefslogtreecommitdiff
path: root/sc/source/core
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/core')
-rw-r--r--sc/source/core/data/formulacell.cxx6
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");
{