Improving performance in a multi-core application

I have a serial (non-parallel) application written in C. I modified and rewrote it using Intel Threading Building Blocks. When I run this parallel version on an AMD Phenom II machine, which is a quad-core machine, I get a performance gain of more than 4X, which is against Amdahl's law. Can someone explain to me why this is happening?

Thanks, Rakesh.

+3
source share
3 answers

If you are rewriting a program, you can make it more efficient. Amdahl's law limits the number of speedups due to parallelism, not how much faster you can make your code by improving it.

, 4x , proc. , , , . .

TL/DR: .

+4

" " , , , . , , , .

, , , L2 ( ), , . , L2 , , , ( - ). , , .

+2

- , ?

, .

Each core has its own L1 cache, and therefore, simply by using more cores, you increased the amount of cache in the game, which in turn brought more of your data closer to where it will be processed. This in itself can significantly improve performance (as if you had a large cache on one core). Combined with close linear acceleration from efficient parallelization, you can see super-linear performance improvements in general.

+1
source

Source: https://habr.com/ru/post/1758670/


All Articles