[fpc-pascal] Is the TFPGMap.KeyData()/TDictionary.TryGetValue() faster than TStringList.Values[]?

silvioprog silvioprog at gmail.com
Fri Jan 15 00:13:28 CET 2016


On Thu, Jan 14, 2016 at 4:43 AM, Michael Van Canneyt <michael at freepascal.org
> wrote:

> On Wed, 13 Jan 2016, silvioprog wrote:
>
>> Hello,
>>
>> I need two fast list features:
>>
>> Add(Key: string, Value: string);
>> Get(Key: string, Value: string): string;
>
> [...]

> TStringList.Values is extremely slow, this is known. It performs a simple
> linear search.
>
> - THashedStringList from inifiles should be faster for name=value.
> - for simple key=value pairs, contrns contains various hash lists.
>

Very nice, I did not know that this classes existed.


> You can include them in your tests to get a more complete picture.


I'm going to do it and get back soon showing the results ... :-)

-- 
Silvio Clécio
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20160114/9f4622e0/attachment.html>


More information about the fpc-pascal mailing list