AnsweredAssumed Answered


Question asked by nec_v20 on Nov 27, 2015

The title of this thread is a bit cryptic; however if you read on then you will realise why I chose it.


TANSTAAFL is an acronym which stands for "There ain't no such thing as a free lunch". I am going to show you that this is not necessarily true.


I will be referring the FM2+ AMD APUs because those are the ones I am familiar with. I will be exclusively be referring to the CPU portion and not the GPU portion of the chip.


I would like you to ask yourself, where does the performance for the CPU come from? I can bet that the first thing which comes to mind is the clock speed and you would be completely wrong.


The CPU gains its performance from what is known as "Cache Memory". This is a portion of the APU chip which buffers reads from the much slower RAM. When a CPU is working on instructions the Cache will read ahead from RAM the instructions which the CPU will be working on next. Without the Cache the CPU would be twiddling its thumbs waiting for the much slower RAM to supply the next piece of instruction for it to work on. If the next instructions aren't in RAM then they will be loaded from your SSD, HD, USB drive or optical drive, but the CPU will still be able to work on what is stored in the Cache whilst those much slower subsystems supply the data.


An APU such as the A10 7870K consists of a CPU portion which is split into two modules and each of those modules is further split into two cores giving you four cores in total. There are two kinds of Cache, a small L1 Cache (which, if I remember correctly, is split into 4*16KB Data and 2*96KB Instruction Cache).  The L2 Cache is what is commonly meant when people talk about "Cache Memory" and in the 7870K it is  divided into 2MB per module and the two cores in the module share the 2MB L2 Cache.


A programs ability to use more than one core is called "multithreading" so whilst one core is working on instructions associated with the program another core is working on another portion. This is all fine and good, however Microsoft Windows likes to throw a wrench in. The OS will decide which cores are being underutilised and shift running tasks to that core or cores. When this happens across modules then the Cache data the core was working from is no longer available to it and it will have to request the data from RAM again.


Games are not generally more than dual multithreaded as far as I have been able to ascertain - there might be certain games which make full use of all threads available to them. I am not however getting into a discussion about that.


Windows does however have one nifty little feature which is often overlooked. I first came into contact with it back in the day of Win NT 4.0 when I was working with SMP machines (SMP stands for Symmetric MultiProcessing) where one had two or more CPUs each with one core running in the system. Nowadays nearly all computer systems are SMP systems except that all the CPUs are in one package.


If you start the WIndows Task Manager and you click on the "Processes" tab you will see everything that is running on your system. If you right-click on any one of the processes you will see and option entitled "Set Affinity...". Do not even remotely entertain the thought of clicking on the option above it called "Set Priority", futzing about with this option is guaranteed to end in tears.


With the "Set Affinity..." option you can constrain the process to one or more cores in your system. All well and good, but it is a PITA to do for every process and what is worse is that as soon as you reboot the configuration that you did is gone and you would have to do it again.


Enter a nifty little free utility called "CPU Control" - CPU-Control (Win 98/2000/XP/Vista/7). With this utility you can assign all running processes to CPU 0 and 1 (which run in Module 0) and if you then load up a game you can assign that game exclusively to CPU 2 and 3 (which run in Module 1). What this means is that Windows cannot trash your game performance by swapping it to a core which leaves it bereft of its associated L2 Cache entries. You can save these entries as profiles and load them up at any time. Nor can the game decide to swap cores because the one it is using has other calls made on it and is blocked (pre-emptive multitasking).


This can make the difference between a game being painfully slow, and actually playable. The most dramatic instance of this that I can remember is with Command&Conquer (I think it was "Generals") running on a dual-core laptop. When I loaded the game up (essentially a process of deciding which of us would die first and made me yearn for the time that I used to spend watching grass grow and paint dry) it was a case of clicking on something and waiting for ages for that to register and then moving the mouse which again took a long time for the cursor to move. After assigning all the processes except for the game to CPU0 and gave the game CPU1 exclusively I could click on a unit and it would register immediately, I could then move the mouse and the cursor would move gracefully across the screen and after clicking on the portion of the screen the unit would start to move right away.


I am not saying that this will cure all your problems, but it might make enough of a difference for you to actually enjoy your experience.


I hope this will be useful to you.