Closed mitchmindtree closed 6 years ago
Just came across the phf crate in a totally unrelated article - it looks like this crate provides tools for generating a custom hashmap type which optimises down into efficient lookup tables which would probably be a lot faster again. It does however look a little more complicated to setup, so it would be worth researching the limitations etc before diving in.
Currently the audio server uses the std hashmap which is a cryptographically secure hash map. This kind of hashmap is more suitable to use with web servers - the provided security is overkill for the audio server and not worth the cost.
fxhash seems to provide a much faster hashing algorithm optimised for 32-64bit size keys, which is pretty much what we use exclusively throughout the audio server. If the hashmap begins showing up as a bottleneck in profiling this will likely be an easy solution.