[fpc-devel] Faster InitObject

Hans-Peter Diettrich DrDiettrich1 at aol.com
Thu Feb 23 11:59:20 CET 2012


Amir schrieb:
> Hi,
> 
>    I have a code, developed in object pascal, with many classes. The
> project is working fine.
>    Today, I used callgrind (valgrind --tool=calgrind) to see which
> function consumes the most execution time and I noticed that the most of
> time in my project is consumed by fillchar function.
> 
> Incl.   Self.   Called     Function
> 29.78   29.72    26M        SYSTEM_FILLCHAR$formal$INT64$BYTE
> 19.07   19.07    123M       SYSTEM_MOVE$formal$formal$INT64
>   3.63    3.63    70M       SYSTEM_SYSGETMEM_FIXED$QWORD$$POINTER
> ....

I suspect that the procedure initialization time is added to the first 
explicit statement. The initialization can include try-except/finally 
blocks, memory allocation (in constructors) or more.

Please create another procedure or method, that uses FillChar not as the 
first statement, and test again.

DoDi




More information about the fpc-devel mailing list