FAO @serodrig - it's almost always worth using unordered_map over map and calling reserve() on any container that implements it.
Cheers,
Stewart