Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Optionally restore arbitrary sleep between frames in dedicated server
This was removed while introducing com_busyWait (PR JACoders#695). Before merging PR JACoders#695, client behaviour was equivalent to com_busyWait 1, while dedicated server behaviour was broadly similar to com_busyWait 0 (run when there is network I/O, or as much as is necessary for sv_fps). However, dedicated servers also had a hard-coded 5ms sleep before each frame during which they did nothing, not even processing network I/O, resulting in the dedicated server never using as much as a full CPU core per process even if the operating system scheduler would have allowed it. That sleep was not reflected in the new code path for com_busyWait 0. This commit makes the sleep time configurable via a new cvar. com_dedicated_sleep 0 is the same as PR JACoders#695 and ioquake3 (best performance), while com_dedicated_sleep 5 is the same as historical OpenJK behaviour (reduced performance, increased latency, ensures that CPU time is made available to other processes). Larger values result in greater reductions to both CPU usage and performance.
- Loading branch information