[fpc-devel] profiling under windows

Jonas Maebe jonas.maebe at elis.ugent.be
Sun Nov 22 18:16:22 CET 2009


On 22 Nov 2009, at 15:31, Paul Ishenin wrote:

> Jonas Maebe wrote:
>> On 20 Nov 2009, at 18:08, Paul Ishenin wrote:
>> 
>> Did you benchmark whether this changed code is indeed faster and whether it makes any difference at all for the compiler? Changing working code because it /might/ become slightly faster that way is not a good approach to keeping source code either maintainable or fast (especially not if it's done by adding more with-statements).
>>  
> 
> I did not benchmarked the changed code. I made the change because of gprof numbers (compiler compiles the compiler):
> 
> %   cumulative   self              self     total          time   seconds   seconds    calls  Ts/call  Ts/call  name   before:
> 0.62      4.27     0.05                             CCLASSES_TDYNAMICARRAY_$__WRITE$formal$LONGWORD
> after:
> 0.37      4.99     0.03                             CCLASSES_TDYNAMICARRAY_$__WRITE$formal$LONGWORD
> 
> On a smaller test (compiling not the compiler but some small application) dynamicarray.read and write were on top of the list.

Rewriting code and guessing that the result will probably be faster is seldom a good idea on modern processors.


Jonas


More information about the fpc-devel mailing list