I am writing an c++ application in visual studio 2010. I run my code under performance wizard and it takes nearly 17 seconds. The codes is really suitable to multhreading so I add openmp directives. After that, I run my codes again and it takes also nearly 17 seconds. So, I wonder what that performance wizard does to optimize the code? Does it analyze the code and makes it multithreaded or simple perform compiler optimizations? How that wizard optimize code?
Edit: I enabled compiler options by adding /openmp option. I am using #pragma omp parallel for directive.I added parallel section codes. it has no bottlenecks, loop iterations do not depend on each other.
#pragma omp parallel for
for (int i = START; i < END; i++) {
solutionList[i] = new Solution(list[i]->solution, direction, i);
}
Performance wizard does not optimize your code at all. It measures the execution of your code — depending on your configuration, by instrumenting the code (making it less efficient but more accurate monitoring). It’s a tool you use to decide which areas of your code to examine for optimization — human optimization of the algorithms, not compiler optimization of the instructions.