The CPU has a power saving mode that lets it slow down whenever a thread is sleeping (even a few milliseconds). In games, the main thread does short bursts of work then sleeps briefly. So the CPU keeps waking up "cold" at a low speed, causing occasional slow frames (the "1% lows").
The patch adds a window where the CPU won't go into the power saving state immediately, so when the thread starts working again the CPU is at full speed already.
"Premature optimization is the root of all evil" is a quote from Donald Knuth, one of the grand oldies of Computer Science. Basically get everything working and tested in the real world before even thinking about optimizing, it may be unnecessary or needed somewhere you didn't expect.
In this case the optimization of spinning down as fast as possible is good in the use case of servers to save power and heat, but not good for gaming.
It'll be interesting to see whether this stays a gaming-specific heuristic or ends up benefiting other bursty workloads as well. Browsers and desktop GUIs tend to have pretty similar burst/sleep patterns.
7 Comments
kayzeekayzee@lemmy.blahaj.zone · 12 pts · 18d
I would love an ELI5 if anyone is offering!
I read the article but still don't really understand.
FauxLiving@lemmy.world · 25 pts · 18d
The CPU has a power saving mode that lets it slow down whenever a thread is sleeping (even a few milliseconds). In games, the main thread does short bursts of work then sleeps briefly. So the CPU keeps waking up "cold" at a low speed, causing occasional slow frames (the "1% lows").
The patch adds a window where the CPU won't go into the power saving state immediately, so when the thread starts working again the CPU is at full speed already.
MalReynolds@piefed.social · 2 pts · 18d
Premature optimization is the root of all evil...
It has a use case, gaming is not it.
Shayeta@feddit.org · 3 pts · 18d
Could you elaborate a bit?
MalReynolds@piefed.social · 10 pts · 18d
"Premature optimization is the root of all evil" is a quote from Donald Knuth, one of the grand oldies of Computer Science. Basically get everything working and tested in the real world before even thinking about optimizing, it may be unnecessary or needed somewhere you didn't expect.
In this case the optimization of spinning down as fast as possible is good in the use case of servers to save power and heat, but not good for gaming.
Shayeta@feddit.org · 5 pts · 18d
That makes much more sense. I though you considered this fix a premature optimization.
Ultimately, I guess it depends on the workload.
hexan0va@lemmy.ca · 1 pts · 18d
It'll be interesting to see whether this stays a gaming-specific heuristic or ends up benefiting other bursty workloads as well. Browsers and desktop GUIs tend to have pretty similar burst/sleep patterns.