Python hash function performance comparison