How are GHz in multicore processors computed?

1

Possible Duplicate:
How fast is each core in a dual-core processor?

I am debating between two systems (for simplicity):

(1) 2.9 GHz dual core processor

(2) 2.3 GHz quad core processor

Now, when I am considering this, I have a few specific questions I would like to answer.

First, how are the 'numbers' (the frequencies) really calculated and what do they mean? For the 2.9 GHz dual core, does that mean that each core is clocked at around 2.9 GHz or does that mean that each core is clocked at 2.9/2 = 1.45 Ghz? In the same way, does the quad core give a 'net' 2.3 GHz speed or is each core literally going at 2.3 GHz?

My hunch from things I have read online is that each core is actually going at the specified speed (I know that you cannot get 12 GHz from a quad core 3 GHz system unless your code is perfectly linear in parallelization).

My other question is, suppose that you have code running purely in parallel. At what point does an extra core enable that code to go faster simply because there is less OS (and other background task) interference?

For example, if I had the choice of 2.6 GHz dual core or 2.5 GHz quad core, even for single threaded programs, I would assume that the 2.5 quad core would go faster because the single thread will be interrupted less by other programs (including the OS).

drjrm3

Posted 2013-01-24T01:19:15.510

Reputation: 1 164

Question was closed 2013-01-24T06:40:34.987

Thanks, I read that question as well as others, but my question also references how the OS and background applications would affect a single threaded application. – drjrm3 – 2013-01-24T01:22:34.453

@Laurbert515 - Your other question would depend on how the software was designed. If you were worried about single threaded performance then the 2.6 Ghz dual core processor would be better. If you talking about overall performance beyond a single thread the 2.5 GHz would be better. – Ramhound – 2013-01-24T01:44:10.037

Answers

3

For the 2.9 GHz dual core, does that mean that each core is clocked at around 2.9 GHz or does that mean that each core is clocked at 2.9/2 = 1.45 Ghz? In the same way, does the quad core give a 'net' 2.3 GHz speed or is each core literally going at 2.3 GHz?

You never, ever, ever add speeds that way. Two cars each going 50 miles an hour does not make anything go at 100 miles per hour, period. If the CPU has a core speed of 2.9 GHz, that means you can clock it at 2.9 GHz, that is, its clock can cycle 2.9 billion times each second.

For example, if I had the choice of 2.6 GHz dual core or 2.5 GHz quad core, even for single threaded programs, I would assume that the 2.5 quad core would go faster because the single thread will be interrupted less by other programs (including the OS).

That's a nonsense question. You can't compare different CPUs based on their clock speeds. It's like saying "you have one vehicle with a 10 gallon fuel tank and one with a 12 gallon fuel tank, which can go further on a tank of gas?" Well, it depends how much they weigh, how big their engines are, and so on.

Never compare CPUs based on clock speeds unless they are otherwise identical. And clearly a dual core and a quad core are very different.

If you imagine two CPUs that differ only in that one is a 2.6 GHz dual core and one a 2.5 GHz quad core, likely there will be no significant different running a single-threaded program, assuming the system isn't heavily loaded by other programs. It's very unlikely that OS overhead would max out a core, and in either case you have at least one core available for OS tasks like disk I/O and interrupts. If the limiting factor is memory bandwidth, for example, more cores don't help.

That said, more cores are almost always better than fewer cores, other things being equal. For a desktop machine, I can't see any point in a dual-core. And, looking towards the future, more and more software will know how to take advantage of more cores.

David Schwartz

Posted 2013-01-24T01:19:15.510

Reputation: 58 310

I have heard the cars analogy and disagree. For someone who knows what they are doing, you can effectively consider 2 cars going at 50 mph to be one car going at 100 mph (say you are trying to take 10 people to a location, making ONE trip with 2 cars will be much better than 2 trips with one car - effectively doubling the speed at which all ten people get there). – drjrm3 – 2013-01-24T01:30:58.537

@Laurbert515 - Whom ever you heard the car analogy from had no idea what they were talking about. How you calculate the frequency of a single CPU core is the same way you calculate the frequency CPU with multiple cores. So you understand a 2.4GHZ quad core means each core is clocked at that frequency.I know that you cannot get 12 GHz from a quad core 3 GHz system Actually this is 100% false. – Ramhound – 2013-01-24T01:42:34.093

1@Laurbert515: Sure, it doubles the speed at which all ten people get there. But that's not a speed that can be measured in miles per hour. That's a speed that might be measured in "people per hour" or maybe the time is halved. But it makes absolutely no sense at all the add the speeds. Nothing is going 100 miles per hour when two cars go 50 miles per hour. – David Schwartz – 2013-01-24T01:52:44.543

Just a tiny nitpick. They have a maximum of 2.9GHz; power management will clock down the cores during idle periods. – Ignacio Vazquez-Abrams – 2013-01-24T01:58:27.130

If the two cars are speeding towards or away from each other then the gap between them grows or decreases at 100 mph. – Sam Axe – 2013-01-24T01:59:10.587

@IgnacioVazquez-Abrams: And on some CPUs, they will up clock the cores under some conditions. Usually, the specified speed is the highest speed at which the manufacturer guarantees you can run all cores stably. (I actually adjusted my wording slightly. Thanks.) – David Schwartz – 2013-01-24T01:59:33.843

@Dan-o: Yes. A quirk in my choice to use linear physical movement as analogy. I should have used two hard drives rotating at 7200 RPM. ;) – David Schwartz – 2013-01-24T02:00:12.017

@DavidSchwartz: rotational movement does not change anything. But nice try :) I think it might be helpful in your answer if you mention that a CPU has a single clock, independent of the number of cores. – Sam Axe – 2013-01-24T02:04:02.773

@Dan-o: That's an implementation detail that doesn't change anything. The answer would be the same even if each core had its own clock and it was possible to vary them independently. (And even though the gap in your car example does increase or decrease at 100 mph, still nothing actually moves at that speed and it doesn't extend to 3 cars or more. It's a quirk of linear physical movement.) – David Schwartz – 2013-01-24T02:05:00.587

ok. either way, good answer – Sam Axe – 2013-01-24T02:08:01.090

I still contend that the 2 cars analogy is a decent depiction of what multiple cores are doing. You can very easily make the analogy that 'people carried per hour' is the same thing as 'iterations of a for loop per second' in which case having two cars carry the same number of people (instead of one car making 2 trips) is the exact same thing as 2 cores going at one speed instead of 1 car doing it. – drjrm3 – 2013-01-24T03:44:28.770

In either case the 'nonsense' question about more cores helping a single threaded program execute more efficiently still has not been answered and is by no means nonsense. When a single threaded program is being executed on a single core machine, it will run slower than it will on a dual core machine because the OS (if nothing else) needs to take control of the core. This same idea can be extended to more cores to argue that more cores can help single threaded programs even if the clock speed is slower. – drjrm3 – 2013-01-24T03:46:19.533

@Laurbert515: In order for your argument to apply, other things have to be equal. When the question is phrased in terms of "a 2.6GHZ dual core CPU" or "a 2.5GHz quad core CPU", there's no suggestion that other things are equal and the answer is that you can't compare core clock speeds across different CPUs. Even with a single core, CPUs differ in the number of instruction cycles needed to execute the same code. Heck, the extra cores could even make the single-threaded program slower as the OS taking the core congests the memory or shared cache bandwidth. – David Schwartz – 2013-01-24T05:17:40.233

@Laurbert515 less cores leaves more cache for individual cores. Also not all multicore processors are created equal. You may see an I3 that is a quad core clocked at the same exact frequency as an I5 quad core. However that I5 is going to smoke the I3 at single threaded performance as the I5 isn't using hyper threading to double the cores it is presenting. Lastly you need to understand that not every CPU cycle is equal; as more components get moved on die more operations can be completed on cpu Clock and not have to wait for the (slower) front side bus clock. – Supercereal – 2013-01-24T14:40:34.853