Free Pascal hashlist race

Which hashlist is the fastest? And which one consumes the least amount of memory?

Show the performance of different Free Pascal hashlist implementations

In the old days, every Pascal developer who needed a list of strings, used a TStringList. It could do anything: hold strings, search, sort, store name-value combinations. And, as a plus, couple objects or tags to each individual string.

Nowadays all this is still possible, but often a TStringList is not fast enough. Because we, developers, are using must larger string-lists now for all kind of applications we could never imagine to be possible 20 years ago. Not using a TStringList, but all kind of hashlists.

For Free Pascal there are so many different hashlist-implementations that it is difficult to know them all. Let alone to make a proper decision on which one to use. I have to confess that most often I don’t really think about it, and just take one. Assuming it will be ‘fast enough’.

But for those who are not so sloppy, or really need the speed, Benito van der Zanden benchmarked all hashlists bundled with Free Pascal, plus some third-party ones. The results are bundled on a website with a clear overview of the memory usage and search- and insertion-speed of the different algorithms, for all kind of use cases. Plus some rules-of-thumb that can help to select the best hashlist for the job.

The website is a must for everyone who uses hashlists a lot.