[fpc-devel] Performance of string handling in trunk

Sergei Gorelkin sergei_gorelkin at mail.ru
Fri Jun 21 16:29:50 CEST 2013


On 21.06.2013 17:11, luiz americo pereira camara wrote:
> 2013/6/21 Michael Schnell <mschnell at lumino.de>:
>> On 06/20/2013 05:31 PM, luiz americo pereira camara wrote:
>>>
>>> Maybe in that example there's going an (unneeded) conversion?
>>
>> If you use the same string type all over the place it would be a severe bug
>> if _any_ conversion is done.
>>
>> Please check.
>>
>
> The affected code can be seen here
> http://forum.lazarus.freepascal.org/index.php/topic,21223.0.html .
>
> I don't have a 2.7.1 setup so i cant debug myself. I'm just reporting
> what the user found
>
I've profiled the code and found no conversions taking place. All the slowdown appears to be caused 
by other reasons, hard to tell the topmost contributor. What catches the eye is the large amount of 
calls to UniqueString, and the fact that SetCodePage goes through implicit try..finally block even 
if it does not need to convert the string.

Regards,
Sergei




More information about the fpc-devel mailing list