3 ms·
Since you have the complete set of blacklist entries each time distribute it, you could compute a perfect hash (zero collisions, no buckets needed) each time yo
by gumby 7y ago
Since you have the complete set of blacklist entries each time distribute it, you could compute a perfect hash (zero collisions, no buckets needed) each time you updated the list.
- strenholme 7y agoYes, we could also store the blacklist as a perfect hash, which would probably give us roughly the same memory usage with O(1) performance. But it would have to be a separate hash than the LRU dynamic hash used for storing DNS entries. Yes, there are dynamic perfect hashes, but they are too slow when we update the hash with each lookup, a common use case with DNS.