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.
This commit is contained in:
scrawl 2017-02-04 02:57:37 +01:00
parent eaeba4138b
commit 2db7292bcb
2 changed files with 4 additions and 1 deletions

View file

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

View file

@ -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 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 exterior grid = true