Use more cores for image decoding and reserve 4 for other important things (main thread, renderg, mesh repo, LFS); bring back FSImageDecodeThreads debug setting

master
Ansariel 2023-12-02 17:59:26 +01:00
parent a92c36a8a6
commit 35de2e2a2f
2 changed files with 20 additions and 2 deletions

View File

@ -26540,6 +26540,17 @@ Change of this parameter will affect the layout of buttons in notification toast
<key>Value</key>
<integer>0</integer>
</map>
<key>FSImageDecodeThreads</key>
<map>
<key>Comment</key>
<string>Amount of threads to use for image decoding. 0 = auto, >= 1 number of threads. Needs restart</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>U32</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>FSPerfFloaterSmoothingPeriods</key>
<map>
<key>Comment</key>

View File

@ -2571,8 +2571,15 @@ bool LLAppViewer::initThreads()
// The only configurable thread count right now is ImageDecode
// The viewer typically starts around 8 threads not including image decode,
// so try to leave at least one core free
S32 image_decode_count = llclamp(cores - 9, 1, 8);
threadCounts["ImageDecode"] = image_decode_count;
// <FS:Ansariel> Override image decode thread config
//S32 image_decode_count = llclamp(cores - 9, 1, 8);
S32 image_decode_count = llclamp(cores - 4, 1, 8);
if (auto max_decodes = gSavedSettings.getU32("FSImageDecodeThreads"); max_decodes > 0)
{
image_decode_count = llclamp((S32)max_decodes, 1, 32);
}
// <FS:Ansariel>
threadCounts["ImageDecode"] = image_decode_count;
gSavedSettings.setLLSD("ThreadPoolSizes", threadCounts);
// Image decoding