There are great answers here.
I would add only from the point of view of performing a large performance tuning, if only each thread was not optimized aggressively, there is a possibility that it has many opportunities to shorten the cycle.
To draw an analogy with a remote rally, there are two ways to win:
- Make the car faster.
- Make fewer stops and side outages
In my experience, most software, as written at the beginning, is quite far from using the most direct route, especially as the software gets larger.
To find the wasted cycles in your program, as Kenneth Cochran said, never guess. If you fix something without proving that it is a problem, you are investing in a hunch.
A popular way to look for performance issues is to use profilers.
However, I do this a lot, and my method is this: http://www.wikihow.com/Optimize-Your-Program%27s-Performance
Mike dunlavey
source share