Kaydet (Commit) 9c88d6f2 authored tarafından Dennis Francis's avatar Dennis Francis

halve thread count if HT active for group interpreter too

Change-Id: Iacc93122191152183127500a4172358a14e96c8b
üst bc6a5d8e
...@@ -49,6 +49,7 @@ ...@@ -49,6 +49,7 @@
#include <tokenarray.hxx> #include <tokenarray.hxx>
#include <comphelper/threadpool.hxx> #include <comphelper/threadpool.hxx>
#include <tools/cpuid.hxx>
#include <formula/errorcodes.hxx> #include <formula/errorcodes.hxx>
#include <formula/vectortoken.hxx> #include <formula/vectortoken.hxx>
#include <svl/intitem.hxx> #include <svl/intitem.hxx>
...@@ -4360,6 +4361,8 @@ bool ScFormulaCell::InterpretFormulaGroup() ...@@ -4360,6 +4361,8 @@ bool ScFormulaCell::InterpretFormulaGroup()
return false; return false;
} }
static bool bHyperThreadingActive = tools::cpuid::hasHyperThreading();
// Then do the threaded calculation // Then do the threaded calculation
class Executor : public comphelper::ThreadTask class Executor : public comphelper::ThreadTask
...@@ -4404,6 +4407,9 @@ bool ScFormulaCell::InterpretFormulaGroup() ...@@ -4404,6 +4407,9 @@ bool ScFormulaCell::InterpretFormulaGroup()
comphelper::ThreadPool& rThreadPool(comphelper::ThreadPool::getSharedOptimalPool()); comphelper::ThreadPool& rThreadPool(comphelper::ThreadPool::getSharedOptimalPool());
sal_Int32 nThreadCount = rThreadPool.getWorkerCount(); sal_Int32 nThreadCount = rThreadPool.getWorkerCount();
if ( bHyperThreadingActive && nThreadCount >= 2 )
nThreadCount /= 2;
SAL_INFO("sc.threaded", "Running " << nThreadCount << " threads"); SAL_INFO("sc.threaded", "Running " << nThreadCount << " threads");
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment