Yiannis:
I got an old Athlon 1800+ running at 1.5 GHz. My machine isn't very fast. And YES, I *did* disable the stability tweak.
Second: The measurement used by wxStopWatch isn't very accurate. This, and taking into account that the times are
calculated in VERY TIGHT loops and then added. CPUs don't use subatomic clocks for
time measurement, and noticing that each call to this routine may take about 10ms, i'm sure there are cumulative rounding errors.
(The full-rebuild version takes about 10 seconds to calculate, and the SDK test takes about 5 seconds. So I'd say the reported times are 4X the real time ellapsed.)
However, we should pay attention to the RELATIVE times. So call them milliseconds, or clock ticks, the point is that some parts of the routine take much longer than they should.
Remember you told me that the string replacing parts weren't very CPU-consuming? Well, the reported time was less than 5% the total times for the calculation.
Also take into account the percentages. The numbers for the SDK calculation are proportional to the numbers for the full-rebuild calculation. So the numbers do make sense.
Edit: here they are, the normalized times.
Timer 1: 0
Timer 2: 5046 ms (40.16%)
Timer 3: 1312 ms (10.44%)
Timer 4: 0 ms
Timer 5: 1189 ms (9.46%)
Timer 6: 0 ms
Timer 7: 3142 ms (25.01%)
Timer 8: 15 ms (0.12%)
Timer 9: 0 ms
Timer 10: 1577 ms (12.55%)
Timer 11: 16 ms (0.13%)
Timer 12: 0 ms
Timer 13: 218 ms (1.73%)
Timer 14: 48 ms (0.38%)
Timer 15: 0 ms
Total "time": 12563
All Targets
---------------
Timer 1: 0 ms
Timer 2: 17007 ms (41.61%)
Timer 3: 3243 ms (7.93%)
Timer 4: 0 ms
Timer 5: 3733 ms (9.13%)
Timer 6: 16 ms (0.04%)
Timer 7: 10747 ms (26.29%)
Timer 8: 78 ms (0.19%)
Timer 9: 0 ms
Timer 10: 5030 ms (12.30%)
Timer 11: 32 ms (0.08%)
Timer 12: 0 ms
Timer 13: 894 ms (2.19%)
Timer 14: 110 ms (0.27%)
Timer 15: 0 ms
Total "time": 40874
So, for both cases, timer2 gets 41%, timer7 gets 25% and timer10 gets 12%.
Now, how are we gonna solve this?
We could, for example, move some of the calculations to outside the loop (that calls the function in question), because they're dependent on the target, not on the filename. I'd appreciate if you gave more details on what strings exactly you're generating. All those replaced macros get me dizzy.