[fpc-devel] PShortString
Daniël Mantione
daniel.mantione at freepascal.org
Fri Sep 10 08:02:58 CEST 2010
Op Fri, 10 Sep 2010, schreef Hans-Peter Diettrich:
> Sergei Gorelkin schrieb:
>
>>> When dynamic strings are used all around, is the use of pointers to
>>> ShortString still recommended? (fmodule contains a lot of them)
>>>
>> Whenever you care about performance, you'll quickly realize that dynamic
>> strings are plain inappropriate.
>
> The concrete use of PShortString strings is inappropriate in your sense,
> because it results in allocation, copy and deallocation of temporary strings
> in the code, in many places. This behaviour gave birth to my question.
Ansistrings result allocation copy and deallocation during *processing*.
The use of ansistrings would make the compiler at least twice as slow and
quadruple its memory consumption.
Daniël
More information about the fpc-devel
mailing list