"Faster than Rust and C++: the PERFECT hash table"

Christopher Katko ckatko at gmail.com
Mon Dec 11 14:15:06 UTC 2023


Hmm, so it looks like a part of what I'm thinking of, is called a 
"perfect hash function".

https://en.wikipedia.org/wiki/Perfect_hash_function

And I probably could still generate one, based on known a 
load-time constant such as all the names/set of all textures in 
game+[loaded mods].

I wonder if using const strings keys (e.g. "grass01") in my code 
is a significant slowdown compared to an int key. I should 
probably do some benchmarks. Because if they are, maybe I could 
do some tokenization pass converting all strings into ints. But 
if I'm adding an entire parsing copy-paste step to my makefile, 
it better be for a significant improvement to justify the 
complexity, maintainability, etc.

And of course, what to do about modding adding stuff without 
recompiling.

I'm just looking into what all my options are given various 
constraints.




More information about the Digitalmars-d mailing list