[fpc-devel] TFPHashList (Was: Alternative parsers)

Florian Klaempfl florian at freepascal.org
Wed Oct 20 10:16:53 CEST 2010


Am 20.10.2010 09:23, schrieb Alexander Klenin:
>>> Benchmarking included 3*10^6 calls to Add and Find methods
>>> with the arguments of various lengths.
>>>
>>> Average string length 5 characters:
>>> ShortString: 1.15 s
>>> AnsiString: 1.56 s
>>>
>>> Average string length 45 characters:
>>> ShortString: 12.0 s
>>> AnsiString: 3.2 s
>>>
>>> I agree that the first case is more relevant for the compiler,
>>> but still you can see that ShortStrings are clearly not always faster.
>>
>> I'm always open for benchmark tests.
>>
>> Can you please send me your test and the implementation ?
>> I'd like to see when the balance shifts.
> 
> Sure, see attachment.
> Note that I made shortstring->ansistring text replacament
> followed by minimal fixed to get working Add and Find methods.
> Other methods may be broken as a result.

Also Add is probably broken. I cannot see where AddStr does proper ref.
counting.



More information about the fpc-devel mailing list