I'm skeptical that "hashing is much faster on an array the size of a power of two".
Also, if memory is actually an issue, he should store hashes instead of full objects (assuming the byte arrays are more than 16 bytes).
Also, if memory is actually an issue, he should store hashes instead of full objects (assuming the byte arrays are more than 16 bytes).
But, since the hash table is not going to grow in this particular case, any perf gain from using a power of 2 will probably be far less important.
1. If you're using a non-trivial hash function, one more modulo calculation at the end to get the actual memory address is not a big difference.
2. If you're using a trivial hash function, I bet for a lot of data sets you'll get fewer collisions with a hash table whose size is a prime number, canceling out any benefit from calculating the address slightly faster.