[fpc-devel] Forwarded message about FPC statusy
Florian Klaempfl
florian at freepascal.org
Tue Dec 25 15:08:09 CET 2012
Am 25.12.2012 14:59, schrieb Yury Sidorov:
> From: "Yury Sidorov" <jura at cp-lab.com>
>> From: "Florian Klaempfl" <florian at freepascal.org>
>>
>>> Am 25.12.2012 13:39, schrieb Yury Sidorov:
>>>> It is possible to seed-up compilation by allocating memory for nodes
>>>> from some zero pre-filled memory pool to avoid costly calls to heap
>>>> manager and avoid zero filling of small memory chunks. A base class for
>>>> various FPC nodes should be modified to handle aloocation from the
>>>> pool...
>>>
>>> The heap manager itself does already pooling so I don't see much gain
>>> in doing so ...
>>
>> Still zero-filling a million of small memory chunks is very time
>> consuming. It is better to pre-zerofill big pool blocks first and then
>> assueme that memory already zero fillled in custom object init code.
>>
>> Although FPC heap manager is good, but custom pool memory allocation
>> will be much faster, since it will be very simple:
>>
>> Result:=CurPoolPtr;
>> Inc(CurPoolPtr, BlockSize);
>> if CurPoolPtr > MaxPoolPtr then AllocNewZeroFilledPool();
>>
>> It is not needed to handle memory releases during object destruction.
>> Since all nodes are available during whole compiling phase (parsing,
>> code generation, etc) and released only at the end of a phase, it is
>> possible just to release whole pool blocks at the end of a phase.
>>
>> Such pooled base class for compiler nodes should inrease performanse a
>> lot.
>
> Hmm, Seems to be a false alarm :(
>
> I've made some tests just now with memory allocation and found that such
> pooling will not speed up the compiler too much. Only minor improvement
> such as 10-20% :(
Ops, messages crossed :) I'd expect no more. One thing might be to
rewrite the whole unit handling so that symtables etc. can be
read/written as one block to PPUs but doing so might be also pretty time
consuming and I doubt the maintainability of such an approach.
More information about the fpc-devel
mailing list