Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2020-08

Difference between Associative array and Hashlist?

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Unknown author

Since FPC has no associative array I was thinking that the closest is TStringList with name/value pairs.

Then there is a hashlist in contnrs.

Maybe an associative array means you don't have to implement it using hashes in order for it to work?

If there is a need for one I might write one as the TStringList is a bit slow, but do they already exist elsewhere before undertaking it...

Sven Barth
to Unknown author
Lars wrote 10 lines
Since FPC has no associative array I was thinking that the closest is TStringList with name/value pairs. Then there is a hashlist in contnrs. Maybe an associative array means you don't have to implement it using hashes in order for it to work? If there is a need for one I might write one as the TStringList is a bit slow, but do they already exist elsewhere before undertaking it...

I suggest you to take a look at TDictionary<,> in Generics.Collections. You can find a comparison regarding performace of various hash list classes available with/for FPC here:
http://www.benibela.de/fpc-map-benchmark_en.html

Regards,
Sven