by compsciphd · 2y ago · 0 comments
if you're parsing the file row by row, iterating over the trie as you process each character (as they argue to calculate the int value) (so what you have to do to hash it anyways), should be similar. What you'd end up in is micro-architectual issues on cache performance.
Tries have to allocate, walk, and interpret multiple nodes. Perhaps not as bad as trees (though that depends on how many possible trie node representations there are, vs what the data density is at each level), but still worse than the non-colliding hash.
That said, with a finite dataset a perfect hash would probably beat a general hash though.
Kind of like linked lists...conceptually pleasant but rarely if ever the best option for real-world perf.