Add new setting for the number of preloading worker threads

If you have CPU cores to spare, consider setting 2 or 3. Up to about 3 threads, preloading performance seems to increase in a linear fashion, but with 4 or more threads I/O bottlenecks and synchronization overhead starts to show.
pull/140/head
scrawl 8 years ago
parent eaeba4138b
commit 2db7292bcb

@ -158,7 +158,7 @@ namespace MWRender
: mViewer(viewer) : mViewer(viewer)
, mRootNode(rootNode) , mRootNode(rootNode)
, mResourceSystem(resourceSystem) , mResourceSystem(resourceSystem)
, mWorkQueue(new SceneUtil::WorkQueue) , mWorkQueue(new SceneUtil::WorkQueue(Settings::Manager::getInt("preload num threads", "Cells")))
, mUnrefQueue(new SceneUtil::UnrefQueue) , mUnrefQueue(new SceneUtil::UnrefQueue)
, mFogDepth(0.f) , mFogDepth(0.f)
, mUnderwaterColor(fallback->getFallbackColour("Water_UnderwaterColor")) , mUnderwaterColor(fallback->getFallbackColour("Water_UnderwaterColor"))

@ -42,6 +42,9 @@ exterior cell load distance = 1
# Preload cells in a background thread. All settings starting with 'preload' have no effect unless this is enabled. # Preload cells in a background thread. All settings starting with 'preload' have no effect unless this is enabled.
preload enabled = true preload enabled = true
# The number of threads to be used for preloading operations.
preload num threads = 1
# Preload adjacent cells when moving close to an exterior cell border. # Preload adjacent cells when moving close to an exterior cell border.
preload exterior grid = true preload exterior grid = true

Loading…
Cancel
Save