Discrepancy between Wiki and Config
Obscure2020 opened this issue · 5 comments
I've found a strange discrepancy between what actually showed up in my Smooth Boot config .json
and what the Smooth Boot wiki says should appear in the .json
. The page of the wiki in question is Configuration ~ Fabric 1.16+.
You see, my CPU has 4 cores, but 8 threads thanks to Intel Hyperthreading. (It's a 10th-Gen Intel Core i7.) The page of the wiki linked above states that certain thread counts are supposed to be calculated from your CPU's thread count, but the values I found in my .json
(which I have not modified) do not match what the wiki suggests should be there. The wiki also states the Thread Priority values that Smooth Boot uses, but once again, the numbers provided by the wiki do not match up with what I found in the .json
.
Now, for the Thread Priorities I suspsect the wiki just needs to be updated. The Thread Count discrepancy is more worrying, though. Either the wiki is lying, or the Smooth Boot is calculating the thread count incorrectly.
Here are my findings regarding Thread Count:
Option | Vanilla Default Value, according to wiki | Smooth Boot Default Value, according to wiki | Expected Value on My Computer | Actual Value found in config .json |
---|---|---|---|---|
Bootstrap Worker Thread Count | Total CPU threads, up to 7 | 1 | 1 | 1 |
Main Worker Thread Count | Total CPU threads, up to 7 | 1/2 of total CPU threads | 4 |
Here are my findings regarding Thread Priority:
Option | Vanilla Default Value, according to wiki | Smooth Boot Default Value, according to wiki | Actual Value found in config .json |
---|---|---|---|
Game Thread Priority | 5 | 5 | 5 |
Bootstrap Worker Priority | 5 | 3 | |
Main Worker Priority | 5 | 3 | |
IO Worker Priority | 5 | 3 | |
Integrated Server Priority | 5 | 5 | 5 |
Ooh! I was right! SmoothBoot is actually programmed wrong, and the wiki is lying!
I found the line of code responsible for calculating the default Config values, and that line is indeed written wrong.
I'm going to assume that the 1/2 of total CPU threads
stated by the wiki is what it's supposed to be. I think I'll try my hand at fixing this myself and submitting a pull request, as I've never submitted a pull request before and I should probably learn how.
Hang tight.
I think the wiki is very outdated by this point. Right now the default values of the mod config is CPU threads - 1
, and it's likely better than limiting to 7 or 1/2 of total thread count especially for systems with higher thread counts. It's probably better to just update the wiki with the current default config values.
Actually, I think CPU threads / 2
is the better option. As total system threads increase, Minecraft will likely need fewer of them to run adequately. I think it's worth testing on more machines (I've already tested it on mine), but I think CPU threads / 2
will still provide the game with enough threads to run well without bogging down the rest of the system unnecessarily.
On my 8-thread CPU, a 7-thread game runs alright. But so does a 4-thread Minecraft.
On a 24-thread CPU, does the game really need 23 threads? No. It'll be more than fine with 12.
And for that matter, we're only specifying the default here. The user still has the ability to change their config if they want more threads.
They also still have the ability to install other mods to increase parallelization, such as C2ME, which I use.