If i replace a single-core processor with a dual-core processor, Will it increase the throughput by two times ? If No, why throughput does not get doubled ?
migrated from stackoverflow.com Jun 17 '10 at 19:19
|
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:
|
|||
|
|
|
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. |
|||||
|
|
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. |
|||
|
|
|
Only for things that are CPU bound. Things that are memory bandwidth or I/O bound will probably not improve at all. |
|||
|
|
|
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). |
|||
|
|