News for hackers. Stuff that matters.
Re:Cttrie – Compile-time trie-based string matching for C++ by ur-whale on Friday September 14, 2018 @04:33PM (#17990698)
The hash has to look at all the chars in the string.

Does the trie have to as well?

Re:Cttrie – Compile-time trie-based string matching for C++ by beached_whale on Friday September 14, 2018 @11:32PM (#17992851)
The string compare has a lot of branching and looks at both strings. The hash method one checks the hash of the test string(size_t) with the size_t of the other string. The hash itself, say fnv1a, can be very quick(a xor and a multiply I think per character) I think I remember testing this and it was quicker. ill try to find the test, but it is easily done. Either way, it's the only way to use a switch statement this way
Re:Cttrie – Compile-time trie-based string matching for C++ by slededit on Friday September 14, 2018 @04:37PM (#17990727)
If it’s possible for the string to not be in the set then you have to look at all chars.

Otherwise there are some cases you can skip characters. I generally don’t use this optimization when writing Tries because it’s tricky and rarely makes a difference.