If you’ve discussed game optimization on message boards or forums before, you’ve probably seen people say thing like “this game only uses 2 cores”, this game only makes use of 4 cores”, etc. This is usually a misinterpretation of CPU usage statistics. There’s two ways that people generally interpret the amount of cores used by a game. The first way is simply looking at the % usage on each individual core, and assuming it isn’t being used by the game if the usage is low. The second way is looking at the % usage of the game, and using that to mathematically determine how many cores are being used. For example, if the user has a 6-core CPU, and CPU usage at 50%, they would assume that the game only uses 3 cores.
Neither of those methods accurately reflect how many cores the game actually benefits from. The thing is, people don’t consider is that certain portions of a program may have infinitely parallel code, whereas other portions of it must be operated in serial. You might have some portions of the code where the rate is completely limited by your single-threaded performance, and other portions of the code are limited by complete parallel performance. Essentially, some parts may only use one core, whereas other portions of the code may in theory could use 16 cores or more. This could “average out” in the end to what seems like 4 cores depending many factors.
The task manager and other CPU monitoring programs operate by counting the number of CPU cycles in which the CPU is operating a specific process over the past few seconds. It then creates a percentage based on the number of cycles it was active. The numbers you see are essentially an average usage over the past few seconds. A game loop operates anywhere from 30-200 times per second depending on your computer’s speed and the game, so this means the workload is rapidly switching between parallel and serial workloads dozens of times per second. This is much too quick to be noticed when looking at the task manager, as the overall usage seen is just an average.
Another thing to consider is that the operating system or the program can and may dynamically move threads between different cores. This means that a program with 4 threads could in theory operate on all 8 cores at different times, making it appear that all 8 cores are being used, even though the program only contains 4 threads. This is done for power saving and heat-reduction purposes, as it balanced workloads between the cores in order to avoid pushing a specific core too hard if it isn’t necessary.
How To Know How Much a Program Benefits From More CPU Cores
The only way to truly know how many cores a program benefits from is to benchmark it with different amounts of cores with the same CPU. CPU cores can be disabled in BIOS, or the user can change the affinity of the program in the task manager to set it to only run on specific cores. From there you can evaluate CPU performance on different amounts of cores. You may surprised to find that a game that only uses 50% of your CPU on your 8 core processor actually performs worse when you set it to only run on 6 cores.