CPU Performance
The three factors that decide how fast a processor is, why doubling the cores does not double the speed, and how to compare two CPUs in an exam answer.
The three factors
Three characteristics affect CPU performance. You must be able to explain all three and, more importantly, explain the limits of each.
1. Clock speed
The clock produces a regular electrical pulse. One pulse is one clock cycle, and roughly speaking one instruction is processed per cycle. Clock speed is measured in hertz.
- 1 Hz = one cycle per second
- 1 MHz = one million cycles per second
- 1 GHz = one billion cycles per second
A 3.2 GHz processor completes 3.2 billion cycles every second. Higher clock speed means more instructions executed per second, so the computer is faster.
Raising clock speed raises heat and power consumption sharply. Beyond a certain point the chip cannot be cooled reliably, which is why clock speeds have barely moved in twenty years. This is the point that earns you the higher marks.
2. Number of cores
A core is effectively a complete processing unit: it has its own ALU, control unit and registers. A dual core CPU has two, a quad core has four.
Each core can fetch, decode and execute instructions independently and at the same time, so in theory four cores complete four times as much work per second.
In practice they do not, for two reasons:
- Not all software is written to use multiple cores. A program that runs as a single sequence of instructions can only use one core, no matter how many are available.
- Cores must communicate and share resources. Coordinating work between cores, and sharing cache and memory, adds overhead.
A quad core processor can process four instructions simultaneously, but only if the software has been written to divide the work between cores. Otherwise the extra cores sit idle.
3. Cache size
Cache is fast memory close to the CPU holding recently and frequently used instructions and data. Larger cache means a greater proportion of requests are found there rather than in the far slower RAM, so the CPU spends less time waiting.
Beyond a point, extra cache gives smaller and smaller gains, because the most useful data is already in there, and larger cache is slower to search as well as more expensive.
- Clock speed: how many cycles the processor runs each second.
- Cores: how many instructions it can genuinely work on at once.
- Cache: fast memory on the chip, so it waits for RAM less often.
- A bigger number is not automatically a faster computer.
Comparing two processors
Exam questions often give you two specifications and ask which is better, or ask you to justify a choice for a particular use.
| Processor A | Processor B | |
|---|---|---|
| Clock speed | 3.8 GHz | 2.9 GHz |
| Cores | 2 | 8 |
| Cache | 4 MB | 16 MB |
There is no single right answer here, and the marks are for the reasoning.
- For software that runs as a single thread, such as many older games or a simple script, Processor A may well feel faster, because each individual instruction stream is processed more quickly.
- For video rendering, compiling code or running many programs at once, Processor B wins comfortably, because the work can be divided across eight cores and it also has four times the cache.
Never just pick one. Say what each is better at, name the factor that causes it, and then commit to an answer for the specific use in the question. A justified answer with a clear conclusion scores highest.
A note on multi core versus multi threading
You are not required to go deep on threading at GCSE, but you should know that a thread is a sequence of instructions. Software that is multi threaded can split its work into several threads, which the operating system can then place on different cores. Software that is single threaded cannot, which is the real reason extra cores sometimes make no difference at all.
Key terms you must be able to define
- Clock speed
- The number of fetch decode execute cycles a processor can perform each second, measured in hertz.
- Hertz (Hz)
- One cycle per second. A gigahertz is one billion cycles per second.
- Core
- A complete processing unit within a CPU with its own ALU, control unit and registers, able to execute instructions independently.
- Multi core processor
- A CPU containing two or more cores, allowing several instructions to be processed at the same time.
- Cache
- Small, fast memory close to the CPU that holds recently or frequently used data and instructions.
- Thread
- A single sequence of instructions that can be scheduled onto a core.
Flashcards
Say the definition out loud before you flip the card. Retrieving it from memory is what builds recall, reading it again is not.
Reach the top grade on this topic
The difference between a level 5 and a level 9 answer on this topic is almost entirely about stating the limitation.
Anyone can write "more cores means faster". The mark for AO2 comes from writing "more cores means faster only if the software is written to use them, because a single threaded program will run on one core and leave the others idle".
Do the same for each factor:
| Factor | The basic point | The point that gets the extra mark |
|---|---|---|
| Clock speed | More cycles per second, so more instructions per second | Heat and power rise sharply, so clock speed cannot be raised indefinitely |
| Cores | Several instructions processed simultaneously | Only if software is multi threaded, and coordination between cores adds overhead |
| Cache | Fewer slow trips out to RAM | Diminishing returns, and larger cache is more expensive and slower to search |
- Practise writing a three sentence justification comparing two named processors for a stated purpose
- Always finish a compare question with a clear decision, not a shrug
Mistakes that cost marks here
- Writing that a quad core processor is always four times faster than a single core one. It is not, because most tasks cannot be perfectly divided.
- Confusing clock speed with the number of instructions. One cycle is roughly one instruction, but they are not the same thing.
- Saying cache 'stores more programs'. Cache stores small amounts of frequently or recently used data and instructions, not whole programs.
- Giving a comparison answer with no conclusion. If the question says justify, you must commit to a choice.
- Using the word 'faster' with no explanation of what is actually happening.
Clock speeds stopped climbing around 2005. Chips hit roughly 4 GHz and further increases produced so much heat they became impractical. That physical wall is exactly why manufacturers switched to adding cores instead.
Knowledge check
Exam-style questions
Five written questions in the style of the real paper. Write a full answer, then let the marker check it against the mark scheme.
- LThe number of cycles or instructions performed each second
- LMeasured in hertz, commonly gigahertz
Clock speed is the number of fetch decode execute cycles a processor completes each second. It is measured in hertz, and modern processors are usually quoted in gigahertz, where one gigahertz is one billion cycles per second.
- LThe program must be written to divide work across multiple cores
- LA single threaded program can only run on one core, leaving the others idle
- LSome tasks are sequential and cannot be split because later steps depend on earlier results
- LCoordinating cores and sharing cache or memory adds overhead
A quad core processor can only deliver four times the throughput if the work can actually be divided between the four cores. This requires the program to be written as multiple threads. If the program is single threaded then it runs on one core and the other three sit idle, so there is no gain at all. Even in multi threaded programs, some parts of a task are inherently sequential because later steps depend on results produced earlier, and those parts cannot be run in parallel. In addition, the cores must communicate with each other and share cache and memory bandwidth, and this coordination adds overhead that reduces the theoretical speed increase.
- LRecommends Processor Y
- LVideo editing and rendering can be divided into independent tasks across cores
- LEight cores process far more instructions simultaneously than two
- LThe larger 16 MB cache raises the hit rate so the CPU waits on RAM less often
- LAcknowledges that Processor X has the higher clock speed and would be better for single threaded work
- LConcludes that the parallel nature of video work outweighs the clock speed advantage
Processor Y is the better choice for this company. Video editing and rendering split naturally into independent tasks, such as processing separate frames or segments, so the work can be shared across all eight cores and run simultaneously. Eight cores at 3.0 GHz will therefore complete far more instructions per second on this workload than two cores at 4.1 GHz. Processor Y also has 16 MB of cache rather than 4 MB, which raises the cache hit rate and means the CPU spends less time waiting for data from RAM, and video work moves large amounts of data. Processor X does have the higher clock speed, and it would be the better choice for single threaded software where only one core can be used. However, because video rendering parallelises well, the four times increase in core count and the four times increase in cache outweigh the roughly 37 per cent clock speed advantage, so Processor Y should be chosen.
- LMore frequently or recently used data and instructions can be stored close to the CPU
- LMore requests are satisfied by cache rather than the slower RAM
- LThe CPU spends less time waiting so completes more instructions per second
- LCache is expensive per byte, takes physical space on the chip, and larger caches take longer to search, so returns diminish
Increasing cache size means more of the instructions and data the processor uses frequently can be held in memory that sits inside or very close to the CPU. This raises the cache hit rate, so a greater proportion of requests are satisfied without going out to the much slower RAM, and the CPU therefore spends less time idle and completes more instructions per second. However, making the cache as large as possible is not the best solution because very fast memory is expensive per byte and takes up physical space on the processor die, and a larger cache also takes longer to search, so the performance gains get smaller and smaller as size increases.
- LBoth allow two instructions to be processed at the same time
- LA dual core processor has both cores on a single chip
- LCores on one chip communicate faster and can share cache, reducing latency
A similarity is that both arrangements allow two instructions to be fetched, decoded and executed at the same time, so both can genuinely process work in parallel. A key difference is that a dual core processor has both cores built onto a single chip, which means they are physically much closer together and can share cache and communicate over very short internal connections. Two separate processors must communicate across the motherboard, which is slower, so the dual core arrangement generally has lower latency when cores need to work together.