Someone Else

Robert Moir writes about Operating Systems, Computer Security and Virtualisation.

Common questions about Computer Processors

A number of discussions about processors quickly show the same questions appearing over and over again. This post is designed to help those people who understand why a computer needs a processor (aka CPU), and that different processors exist and which one you choose can make a big difference to performance.

This article isn't meant to be an in-depth review of any particular processor technologies, but rather a quick examination of the common issues and questions that seem to arise when considering and comparing modern processors. As such, the article will gloss over technical details and arguements about a technology in favour of explaining overall concepts.

Is clock speed a useful measure of processor speed anyway?
Clock Speed was, until recently, the only real measure of speed that you ever saw used to describe processors. People used to talk knowingly about Megahertz and Gigahertz, and how they knew a higher number was better.

This is certainly no longer the case, and even when it was true, it was still less useful than many people seem to think.

Let's start with what "Clock Speed" actually means. Clock Speed can be defined as the basic speed at which a computer component such as the CPU takes to perform a basic operation, measured in Hertz (MegaHertz, GigaHertz...). When used as a speed measurement of a computer, the "clock speed" being talked about will be that of the CPU.

The problem with using clock speed to measure processor performance is that different processors can perform a different amount of work in the same clock "tick" or cycle. For example, lets say that processor A runs at 4 Mhz, and processor B runs at 1 Mhz. Each processor executes one processor instruction with every clock tick, so Processor A executes 4 times the amount of instructions as Processor B in a second. Now lets look at those instructions. If we want to multiply two numbers together, processor A needs to perform 10 instructions to complete this operation but Processor B needs only to complete 2 instructions to perform the same task. Which CPU will give you the answer first?

As you see above, comparing CPU performance by clock speed works well only when comparing two CPUs which are identical in every aspect except for clock speed. For comparing two different processors, e.g. an Intel Pentium 4 with an Intel Core Duo or with an AMD Athlon 64, measuring the clock speed only tells us what the clock speed of each processor is. It tells us nothing about how each processor performs in comparison to the others.

Performance in the real world can be even harder to understand, if comparing processors by clock speed. Other important aspects of a processor are the bus speed (the speed the CPU talks to the memory and other components on the motherboard, usually different to the internal clock speed of the processor) and the amount and speed of the cache memory available to the processor.

(Read this article on the Celeron 300a for a classic example of how bus speed and cache make a big difference to a processor).
OK. We get it already. Robert doesn't like Clock Speed as a way of comparing CPU speeds. So what should we do instead?
Benchmark! A Benchmark is a standard set of tests run in a controlled manner that compares how two well two different objects complete the same task. There are several "standard" benchmarks available to test either systems as a whole or to test components (e.g. the video card or the processor) directly. Pick a standard benchmark that roughly emulates the sort of work you do and which can be used on your target systems / components, run it on each benchmarked item several times and use the average of those runs to determine how well the item performs.
What do terms like 'dual core' mean? What's the difference between dual core and dual processor?
A Processor Core is the part of a CPU that actually does the work of carrying out the instructions your programs send to it. A Dual Core processor is a processor chip that contains two of these cores, effectively two CPUs on a single chip. A detailed discussion of Dual Core chips can be found here.

The much older technology of Dual Processor systems have two seperate processor chips installed on the computer motherboard.

Whichever system you use, the two cores operate together to share out the system's processing workload, by noting where tasks are broken down into seperate 'threads', and each one executing it's share of these threads side by side.

From the point of view of the operating system and application programs, Dual Processor and Dual Core systems work much the same way, but electronically they work very differently. As ever, each kind of system has its own advantages and disadvantages.

(To save my fingers a lot of typing and your eyes a lot of reading, please consider the terms "dual core" and "multi-core" to be interchangable with "dual processor" and "multi-processor" for the remainder of this article.)
So, is a 2Ghz Dual Core processor like having two 2Ghz processors, or like one 4Ghz processor?
A 2Ghz Dual Core processor is effectively two 2Ghz processors. It absolutely does not work like one 4Ghz processor. This goes back to the issue of threads I touch upon briefly above, with multiple cores being able to execute multiple threads side by side. This means that a computer can do more things at once, not that it can do one thing faster.
How come, then, that some benchmarks show a single program being executed faster with multiple cores than with one?
This happens for two reasons.
Firstly, many modern programs are multi-threaded, which means their main jobs are split into several different threads in order to allow them to make efficient use of modern computer systems.

Secondly, even a single-threaded application can run slightly faster on a dual core machine, because it can effectively have nearly free reign over one processor while the other tasks on the system make use of the other processor.
What about Hyperthreading?
Hyperthreading is an interesting technology from Intel that creates "logical" processors on top of the real processors, and hence appears to the OS and applications as a multi-processor system.

The idea is that often, not all the parts of a processor core are in use at the same time, and by creating logical processors on top of the physical one, you can do more work by making fuller use of the processor abilities, by allowing threads that do not need to use the same resources in the core to process through the processor at the same time.

There is considerable debate about how well logical processors can emulate real ones. Overall "real world" performance depends very much on what applications you run and whether or not your OS is Hyperthreading aware.

AMD have recently proposed a kind of "reverse hyperthreading" which allows dual-core systems to combine cores to run one single thread between them and effectively try to function as one processor. I guess one day they'll make a liar out of me and my earlier statement about how to consider dual core chips!
What about 64 bits? Everyone was talking about that and now they're talking about dual cores. Are we not bothering with 64 bit any more?
64-bit processors and multi-core processors address different needs. And, of course, many modern processors manage to combine both features quite happily.

Multi-Core processors allow a computer's work capacity to "scale outwards", to take on more work at once.

64-Bit processors allow a computer's work capacity to "scale upwards", to work faster and more importantly to work with larger memory address spaces.
So if I'm building or buying a fast computer, the most important thing is the fastest possible processor?
Nope. The most important thing is understanding how the system will be used and designing a good "balanced" system for that need. Essentially a computer system working on a task can be thought of as like a production line in a factory, and all the steps in the line need to be kept full of just the right amount of material in order for the line as a whole to be working at optimal performance.

Fitting a upgraded packing machine at the end of a factory line will not increase that line's rate of production if the other parts of the factory line are already working at capacity, all that will happen is that the new packing machine at the end of the line will sit idle some of the time.

Installing the fastest processor you can find but fitting the computer with insufficient RAM or a very slow hard disk will constrain the processor and prevent it from reaching its full potential. The same applies of course to neglecting the processor in order to fit very fast RAM or hard disks.
If these lastest processors are so quick why doesn't my desktop seem to be any faster? It still takes about as long to load an application.
This is an example of the sort of contraints I talk about above. Starting a new application is likely to be disk and memory intensive as much as it will be processor intensive. We already passed the point at which a faster processor would help applications load faster, and we're now often constrained by the memory and disk systems loading the application.

Comments

Robert Moir said:

Further reading about the history of Intel compatible processors can be had at http://www.redhill.net.au/iu.html
# July 16, 2006 2:51 PM