I'm creating a chess program that utilizes a hash table of previously evaluated positions to (hopefully) reduce search time. Only problem is I'm using an ArrayList to store the hash values and the lookup time increases based on how many positions i've stored. How can I get a hash table which has a lookup time independent of it's current size? (Forgive me, I'm kinda a noob at java, objective c is really my thing)
Edit: If it matters, I'm using the Zobrist fast hashing technique. Based on some trials, I've determined that it is NOT the generation of the hash keys that takes up the large amount of time. The hashing methods is very fast and its effect on the speed is almost unnoticeable.
The standard Java HashMap is pretty good and already available to you, but if you want the screamingly fastest map in Java use Trove ( http://trove4j.sourceforge.net/html/overview.html ) which is filled with data structures that are optimized for performance.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With