Start networking and exchanging professional insights

Register now or log in to join your professional community.

Follow

How to calculate the expected gain in the performance, if program code needs to be modified from single-thread to multi-threaded?

The cpu on the machine that will run the program has10 cores(20 logical cpus)

user-image
Question added by Deleted user
Date Posted: 2013/08/22
Daanish Rumani
by Daanish Rumani , Product Manager , Publicis Sapient

It actually depends on the nature of the program.
If the program itself is single threaded then the expected gain is zero.
In general if you have n parallel threads in your program you would get performance gain until you use n cores.
You can make a very coarse calculation assuming all the threads have relatively similar loads and processor demands.
n threads on 1 core would take say n units of time.
n threads on n cores would take 1 unit do time.
therefore n threads on m cores where m would take round(n/m) units of time.

More Questions Like This