A hash map provides good performance by locating a value by applying a hash function to the key. Key mapping will pull each item out of the map and reinstall it using a hash of the new key. Of course, all this is doable, but it is quite a lot of work, and therefore it is best avoided.
source share