std::hash<std::string>(largeString1) == std::hash<std::string>(largeString2)
Will be far slower than
largeString1 == largeString2
Hashing a string involve iterating over the entire length of it. So the hash comparison requires the code to iterate the full length of both strings one at a time and run them through complex equations. The straight equality code simply iterates them at the same time and immediately quits the instant it finds a difference. Trust the library. If ==
could be done faster, they would have done it faster.
If you're going to be comparing each string many times, then hashing ahead of time once and comparing just the hashes may be faster, but you would still have to confirm matches since comparing hashes can give false positives. It only makes the "do not match" case faster.