Changeset View
Changeset View
Standalone View
Standalone View
www/firefox/files/patch-bug1473732
- This file was added.
| Base default number of OMTP workers on the number of logical CPU cores. | |||||
| system-info is a stub on Tier3 platforms while physical vs. logical | |||||
| difference only matters for hyper-threading. As hyper-threading | |||||
| is usually available on CPUs with more than 2 physical cores this | |||||
| change has no impact there as the default is clamped to [1, 4]. | |||||
| However, on Intel i3-* CPUs with 2 physical and 4 logical cores this | |||||
| bumps the default from 1 to 3. | |||||
| diff --git gfx/layers/PaintThread.cpp gfx/layers/PaintThread.cpp | |||||
| index ef268f47651b6..f8929d11ae156 100644 | |||||
| --- gfx/layers/PaintThread.cpp | |||||
| +++ gfx/layers/PaintThread.cpp | |||||
| @@ -22,7 +22,7 @@ | |||||
| #include "mozilla/SyncRunnable.h" | |||||
| #include "nsIPropertyBag2.h" | |||||
| #include "nsServiceManagerUtils.h" | |||||
| -#include "nsSystemInfo.h" | |||||
| +#include "prsystem.h" | |||||
| // Uncomment the following line to dispatch sync runnables when | |||||
| // painting so that rasterization happens synchronously from | |||||
| @@ -156,15 +156,7 @@ PaintThread::AddRef() | |||||
| /* static */ int32_t | |||||
| PaintThread::CalculatePaintWorkerCount() | |||||
| { | |||||
| - int32_t cpuCores = 1; | |||||
| - nsCOMPtr<nsIPropertyBag2> systemInfo = do_GetService(NS_SYSTEMINFO_CONTRACTID); | |||||
| - if (systemInfo) { | |||||
| - nsresult rv = systemInfo->GetPropertyAsInt32(NS_LITERAL_STRING("cpucores"), &cpuCores); | |||||
| - if (NS_FAILED(rv)) { | |||||
| - cpuCores = 1; | |||||
| - } | |||||
| - } | |||||
| - | |||||
| + int32_t cpuCores = PR_GetNumberOfProcessors(); | |||||
| int32_t workerCount = gfxPrefs::LayersOMTPPaintWorkers(); | |||||
| // If not manually specified, default to (cpuCores * 3) / 4, and clamp | |||||