Cuberite Forum

Full Version: r339 - Server uses ~40% less CPU now
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
The commit log for rev 339 states:
  • Server uses ~40% less CPU now
This sounds amazing!Big Grin:D How did you pull that off?
I guess it depends - it's the amount chopped off of the tick thread, which itself runs at about 5 % CPU on my machine, so that means now it will run at like 3 % CPU I guess Wink
But maybe I'm wrong, I myself am wondering about the big change FakeTruth did Smile
Apparently the copying of an empty std::map or std::deque 400 times a tick takes a lot of time, so I made a check to see if it contains anything before doing anything else. This brought my CPU from ~10% down to ~6% so, whateverTongue
You might save even more if you use std::swap() instead of copying