Computer Architecture · Cambridge syllabus 3.1 · Lesson 4 of 5
CPU Performance
Clock speed measures clock cycles per second, not directly useful instructions per second. Multiple cores can work concurrently when software permits. Cache reduces delays when frequently needed instructions or data can be obtained without slower main-memory access.
By the end, you can
- Understand what a CPU core is.
- Explain how multiple cores can improve performance.
- Understand the purpose of cache memory.
- Explain how cache can improve CPU performance.
- Understand CPU clock speed.
- Explain how clock speed can affect processing performance.
- Recognise that clock speed alone does not determine overall CPU performance.
Cores
A core is a complete processing unit — its own control unit, ALU and registers — and a multi-core processor has several on one chip. A dual-core CPU has two, a quad-core four.
Each core can fetch, decode and execute its own stream of instructions, so several instructions really are being carried out at the same instant rather than being shared out in turns. Four cores can therefore run four programs at full speed at once, where one core would have to interleave them.
The gain is not four times, though, for two reasons. A program only speeds up if it can be split into parts that run independently, and many cannot: a calculation whose next step needs the previous answer has to wait whatever hardware it is given. And the cores share one path to memory, so they can end up queueing for data.
The practical answer is that more cores help most with several tasks at once, or with a program written to be split up, such as video encoding or rendering. Doubling the cores does not double the speed of a program that cannot be divided.
Worth remembering
- A core is a full processing unit; several on one chip run instructions simultaneously.
- Cores help most with multitasking and with programs written to be split up.
- Doubling cores does not double the speed of a task that cannot be divided.
Cache
Cache is a small amount of very fast memory placed between the CPU and RAM. It exists because RAM is far slower than the processor, and a CPU waiting for data does nothing useful.
When the CPU asks for something, the cache is checked first. If the data is there — a cache hit — it is returned almost immediately. If it is not — a cache miss — the CPU waits for RAM, and a copy of what came back is kept in the cache in case it is needed again.
This works because programs reuse the same data and run the same instructions repeatedly. A loop is executed thousands of times, so after the first pass its instructions are already in the cache, and the slow fetch never happens again.
More cache means more hits and less waiting, so performance improves. Cache is expensive, which is why there is very little of it compared with RAM.
Worth remembering
- Cache is small, fast memory between the CPU and RAM.
- A hit is served immediately; a miss waits for RAM and is then cached.
- Loops and repeated data are what make caching effective.
Clock speed
The clock is a signal that pulses at a fixed rate and steps the CPU through the cycle. Clock speed is how many pulses there are each second, measured in hertz: a 3 GHz processor pulses three thousand million times a second.
A higher clock speed means more cycles a second, so more instructions get executed in a given time and the machine feels faster. Increasing it is the most direct way to make a processor quicker, which is why speeds rose steadily for years.
They then stopped rising, because a faster clock means more heat, and beyond a point the chip cannot be cooled. This is exactly why manufacturers turned to adding cores instead.
Clock speed alone does not determine performance, and comparing two different processors by it is unreliable. A processor that does more per cycle beats a faster one that does less; cache size, core count and memory speed all matter; and a program limited by disk or network speed will not run faster on a faster CPU at all.
- 1 GHz = 1 000 000 000 clock cycles per second
- Clock speed counts pulses each second. A 3.2 GHz processor steps through 3 200 000 000 cycles every second.Hz is one cycle per second; MHz is a million, GHz a thousand million
Worth remembering
- Clock speed is cycles per second, in Hz, MHz or GHz.
- Higher clock speed means more instructions in a given time, but more heat.
- Cache, cores and work done per cycle matter too, so clock speed is not the whole story.
Worked example
A workload that cannot be divided may gain little from extra cores, while independent tasks may run concurrently.
Practice
Warm-up · not marked
Check your understanding
Answer in your own words, then compare with the worked answer. Nothing here is saved or scored.
Worked answer
More frequently needed data or instructions may be available close to the CPU, reducing slower main-memory accesses.
Check your method, units and explanation against it.
Marked practice
Set 1 of 4 · easiest first · Checked as you go, with the worked answer. Sign in or create a free account to save your progress.