perf: Optimize main loop to eliminate idle CPU usage#96
perf: Optimize main loop to eliminate idle CPU usage#96
Conversation
|
I'll note that, since this is a server for low-memory embedded platforms, and not really targeted towards desktop operating systems, a busy-loop is not nearly as big of an issue. This is why the contribution guidelines state to make an issue before a pull request, to discuss the necessity of the change. I'll admit, I've only glanced at the diff, but that seems to be a lot of changes. Even removing some comments and adding a layer of nesting? |
|
My apologies for not opening an issue first. |
52ed27e to
e7106e2
Compare
|
Seems to be a pretty interesting concept tho |
I noticed that the server was using a surprising amount of CPU even when it was just sitting there idle with no players online.
I ran a quick 20-second benchmark (
time timeout 20s ./bareiron) to see what was going on, check the results:Before:
After:
As you can see, the total CPU usage was a whopping 88% just from the server doing nothing!
This is a experimental, i only tested on my machine (x86_64 arch linux) and wine, (both working great)