[fpc-devel] TViHashList and TFPHashObjectList in compiler
Juha Manninen
juha.manninen62 at gmail.com
Tue Sep 22 17:35:51 CEST 2026
runewalsh via fpc-devel kirjoitti 21.9.2026 klo 16.20:
> I made it in
> https://gitlab.com/freepascal.org/fpc/source/-/merge_requests/132.
>
> It’s a synthesis of the old TFPHashList (from which it inherited O(N)
> removals), and my private bleeding-edge hash table based on the Python
> 3.6+ dict:
> https://github.com/zpoint/CPython-Internals/blob/master/BasicObject/dict/dict.md.
Thanks for the information!
I understood it reduces memory consumption a lot which should also
improve speed indirectly in most computers (less memory traffic). Then
if AnsiStrings are used for symbol, it slows down the compilation
because of try..finally blocks. Is it so?
> Such things are not something you should worry about, and they don’t
> concern the compiler’s logic — treat it as a black box.
No, I want to understand everything. :)
I got obsessed with the perfect hash thing for quickly finding language
tokens and directives. I didn't figure out the gperf usage so I made
some code of my own. I may experiment with the compiler code. Let's see.
Juha
More information about the fpc-devel
mailing list