Google hashmap version is 4 times faster but uses twice as much memory