summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Lemire <paul.lemire@kdab.com>2020-04-23 08:54:54 +0200
committerPaul Lemire <paul.lemire@kdab.com>2020-04-23 10:06:17 +0200
commit37735f11f9437b916b194cfd48c452c7c70682f8 (patch)
tree154a11fca9d9d7807caef6fd8b63cd2f4b9b8da5 /src
parent50390aefe6f990aa2b959efd2090b59fef091912 (diff)
Reduce CommandBuilding/Update job spawning threshold
Those jobs are usually the most expensive to run. It therefore makes sense we leverage parallelism as much as possible and not discard threads we could be using. In that sense, the minimum amount of elements to process per job is reduced from 100 to 10 which means that we will spawn threads if they can contain at least 10 element to process (instead of 100 previously). This now allows to benefit from more parallelism on smaller scenes (that have less than 100 entities) while still scaling similarly as previously on larger scenes. Change-Id: I91e97fc23185d02c2727d87bb7a4ea4991f5ff14 Reviewed-by: Mike Krus <mike.krus@kdab.com>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/renderers/opengl/renderer/renderviewbuilder.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/plugins/renderers/opengl/renderer/renderviewbuilder.cpp b/src/plugins/renderers/opengl/renderer/renderviewbuilder.cpp
index 0667c21d3..823937f37 100644
--- a/src/plugins/renderers/opengl/renderer/renderviewbuilder.cpp
+++ b/src/plugins/renderers/opengl/renderer/renderviewbuilder.cpp
@@ -89,7 +89,7 @@ public:
// Split among the ideal number of command builders
const int jobCount = m_renderViewCommandBuilderJobs.size();
- const int idealPacketSize = std::min(std::max(100, entities.size() / jobCount), entities.size());
+ const int idealPacketSize = std::min(std::max(10, entities.size() / jobCount), entities.size());
// Try to split work into an ideal number of workers
const int m = findIdealNumberOfWorkers(entities.size(), idealPacketSize, jobCount);
@@ -348,9 +348,9 @@ public:
}
// Split among the number of command builders
- // The idealPacketSize is at least 100 entities per worker
- const int idealPacketSize = std::min(std::max(100, filteredCommandData->size() / RenderViewBuilder::defaultJobCount()), filteredCommandData->size());
- const int m = findIdealNumberOfWorkers(filteredCommandData->size(), idealPacketSize, m_renderViewCommandUpdaterJobs.size());
+ const int jobCount = m_renderViewCommandUpdaterJobs.size();
+ const int idealPacketSize = std::min(std::max(10, filteredCommandData->size() / jobCount), filteredCommandData->size());
+ const int m = findIdealNumberOfWorkers(filteredCommandData->size(), idealPacketSize, jobCount);
for (int i = 0; i < m; ++i) {
const RenderViewCommandUpdaterJobPtr renderViewCommandBuilder = m_renderViewCommandUpdaterJobs.at(i);