Re: [fpc-devel] Faster InitObject

2012-02-24 Thread Hans-Peter Diettrich
Alexander Shishkin schrieb: You also may refactor your class and define array as a pointer to array (dont use dynamic array - they are zero initialized) and manage memory manually ( [Get|Realloc|Free]Mem ). IMO dynamic arrays are not initialized, at least not in Delphi. Only the pointer is

Re: [fpc-devel] Faster InitObject

2012-02-24 Thread Vincent Snijders
Op 24 februari 2012 13:40 heeft Hans-Peter Diettrich drdiettri...@aol.com het volgende geschreven: IMO dynamic arrays are not initialized, at least not in Delphi. Only the pointer is initialized (to Nil). IMO one should not use IMO when claiming easily verifiable facts, it should be used when

Re: [fpc-devel] Faster InitObject

2012-02-24 Thread Hans-Peter Diettrich
Vincent Snijders schrieb: Op 24 februari 2012 13:40 heeft Hans-Peter Diettrich drdiettri...@aol.com het volgende geschreven: IMO dynamic arrays are not initialized, at least not in Delphi. Only the pointer is initialized (to Nil). IMO one should not use IMO when claiming easily verifiable

Re: [fpc-devel] Faster InitObject

2012-02-24 Thread Vincent Snijders
Op 24 februari 2012 15:14 heeft Hans-Peter Diettrich drdiettri...@aol.com het volgende geschreven: it should be used when writing down an opinion. What's wrong with leaving the check to others? As an exercise... Then you should not write in my opinion, but I think or if I remember correctly.

Re: [fpc-devel] Faster InitObject

2012-02-23 Thread Sven Barth
Am 23.02.2012 08:47 schrieb Amir a...@aavani.net: 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

Re: [fpc-devel] Faster InitObject

2012-02-23 Thread Sven Barth
Am 23.02.2012 09:27 schrieb Sven Barth pascaldra...@googlemail.com: Yes, FillChar is needed, because a class instance is guaranteed to have Bennett initialized with zero before the first constructor is called (this way the fields are basically initialized by 0, Nil or '' depending on the field

Re: [fpc-devel] Faster InitObject

2012-02-23 Thread Tommi Prami
Incl. Self. Called Function 29.78 29.7226MSYSTEM_FILLCHAR$formal$INT64$BYTE 19.07 19.07123M SYSTEM_MOVE$formal$formal$INT64 3.633.6370M SYSTEM_SYSGETMEM_FIXED$QWORD$$POINTER The main caller of FillChar function is

Re: [fpc-devel] Faster InitObject

2012-02-23 Thread Marco van de Voort
In our previous episode, Tommi Prami said: depending on the field type). But still... Any improvement done in the Creating and Freeing an Objects would be welcome :) Usually pooling the most used objecttype(s) is already enough. ___

Re: [fpc-devel] Faster InitObject

2012-02-23 Thread Sven Barth
Am 23.02.2012 10:05, schrieb Tommi Prami: 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 The main caller of FillChar function is

Re: [fpc-devel] Faster InitObject

2012-02-23 Thread Alexander Shishkin
23.02.2012 11:47, Amir пишет: 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

Re: [fpc-devel] Faster InitObject

2012-02-23 Thread Hans-Peter Diettrich
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

Re: [fpc-devel] Faster InitObject

2012-02-23 Thread Amir
On 02/23/2012 02:59 AM, Hans-Peter Diettrich wrote: 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

Re: [fpc-devel] Faster InitObject

2012-02-23 Thread Amir
On 02/23/2012 01:20 AM, Alexander Shishkin wrote: 1) You can override TObject.NewInstance, w|o calling inherited. (Init instance is called from NewInstance) and do whatever you want What does each of the follwoing lines do? It looks like they are setting the function table for the object.

Re: [fpc-devel] Faster InitObject

2012-02-23 Thread Sergei Gorelkin
23.02.2012 13:16, Sven Barth пишет: In August 2010 Florian already said that maybe FillChar should be optimized: http://lists.freepascal.org/lists/fpc-devel/2010-July/021146.html (at the bottom) In early 2011 I wrote an assembler implementation of FillChar for x86_64 (cannot be used for

Re: [fpc-devel] Faster InitObject

2012-02-23 Thread Marco van de Voort
In our previous episode, Sergei Gorelkin said: In August 2010 Florian already said that maybe FillChar should be optimized: http://lists.freepascal.org/lists/fpc-devel/2010-July/021146.html (at the bottom) In early 2011 I wrote an assembler implementation of FillChar for x86_64 (cannot

Re: [fpc-devel] Faster InitObject

2012-02-23 Thread Amir
On 02/23/2012 11:37 AM, Hans-Peter Diettrich wrote: Amir schrieb: 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

Re: [fpc-devel] Faster InitObject

2012-02-23 Thread waldo kitty
On 2/23/2012 03:29, Sven Barth wrote: Am 23.02.2012 09:27 schrieb Sven Barth pascaldra...@googlemail.com mailto:pascaldra...@googlemail.com: Yes, FillChar is needed, because a class instance is guaranteed to have Bennett initialized with zero before the first constructor is called (this way

Re: [fpc-devel] Faster InitObject

2012-02-23 Thread Alexander Shishkin
23.02.2012 22:25, Amir пишет: On 02/23/2012 01:20 AM, Alexander Shishkin wrote: 1) You can override TObject.NewInstance, w|o calling inherited. (Init instance is called from NewInstance) and do whatever you want What does each of the follwoing lines do? It looks like they are setting the

Re: [fpc-devel] Faster InitObject

2012-02-23 Thread waldo kitty
On 2/23/2012 18:54, Amir wrote: On 02/23/2012 02:20 PM, Hans-Peter Diettrich wrote: The initialization of every class instance is a major improvement over e.g. C++ classes. I'd say that you should accept it, instead of searching for workarounds, with hard to predict effects in the remaining