Upgrade von Single Core auf Dual Core - Wird der Durchsatz verdoppelt?

636
Karthik Balaguru

Wenn ich einen Single-Core-Prozessor durch einen Dual-Core-Prozessor ersetze, wird der Durchsatz um das Doppelte erhöht? Wenn nein, warum wird der Durchsatz nicht verdoppelt?

4

5 Antworten auf die Frage

9
John Feminella

It definitely won't increase by a factor of two; that would be a perfectly efficient increase in throughput. That's not possible since there's always some overhead. How much benefit you get will depend on a few factors:

  • It may not increase at all if the OS or programs you're running on it aren't equipped to schedule processes on different cores.

  • It might only increase by a little if the tasks you're doing aren't very parallelizable (e.g. they depend heavily on I/O or other slow non-CPU operations).

  • It might increase by a good deal if the tasks are "embarrassingly parallel", e.g., long runs of identical floating-point computations or prime-number factorization.

  • It might make things worse if there's too much context-switching because of dependencies between the processes, or if you need to sync things across the processes.

5
James Kingsbery

See http://en.wikipedia.org/wiki/Amdahl%27s_law for a good description about why it won't double your throughput, and how to analyze what the improvement actually will be.

Hey James, sehr gute Verbindung! Karthik Balaguru vor 13 Jahren 0
@James +1 Um etwas Neues zu lernen. Ich habe gehört, dass das "Gesetz der sinkenden Renditen" verwendet wurde, um dieses Problem zu beschreiben, aber "Amdahls Gesetz" ist für mich neu. Danke dafür. Evan Plaice vor 13 Jahren 0
0
driis

Your throughput will only be better, if your code is written to take advantage of two processors. Generally, you will need to make sure that your code uses 2 or more threads of execution to perform the job.

Only in some cases you will see performance actually doubled, as there is some book keeping needed in order to have multiple threads running.

0
Chris Dodd

Only for things that are CPU bound. Things that are memory bandwidth or I/O bound will probably not improve at all.

0
Paul R

It depends on what kind of code you're running. If you're compute-bound and your code uses threads then you may see a 2x throughput improvement (at the same clock speed). If you are memory I/O bound or single-threaded then you may see no improvement at all (or even a deterioration in performance).