Handmade Hero » Forums » Code » "TODO: Better hash function"
SirTimothy
Tim Green
3 posts
#16664 "TODO: Better hash function"
2 weeks, 6 days ago Edited by Tim Green on Oct. 31, 2018, 8:52 p.m.

Watching episode 263, Casey just passed by one of the all-important "TODO(casey): Better hash function" comments, pointed out that you always must have that... got me thinking... does Meow Hash have a comment like that? did a quick search in code on GitHub, didn't see one.

Of course, Meow Hash is the better hash function, but I just can't wrap my head around this paradox... Maybe someone should send a Pull Request to add it in somewhere, just to make sure it's a legitimate product?
mmozeiko
Mārtiņš Možeiko
1826 posts / 1 project
#16665 "TODO: Better hash function"
2 weeks, 6 days ago

Meow hash has different purpose. It is meant for large data sizes - think megabytes or even gigabytes. Like assets for game - textures, audio files, meshes, etc.

Hash function in Handmade Hero is used to get index for lookup table. That is usually for small amount of data - think integer/float (4 bytes) or short string. Technically Meow hash will work, but it is not best choice for this.
SirTimothy
Tim Green
3 posts
#16666 "TODO: Better hash function"
2 weeks, 6 days ago

Yeah, I know it has different purpose from what HMH needs, I'm not saying Meow is a replacement for anything used there. I was just pointing out that Meow Hash itself should probably have a "TODO: Better hash function" if it wants to be proper, according to Mr Muratori :)
ratchetfreak
413 posts
#16668 "TODO: Better hash function"
2 weeks, 6 days ago

except he is actively searching for good a corpus to run it against to see how good of the hash it actually is.