Hi I have a question on std::hash if I have 2 large strings for comparison and I am willing to accept that std::hash will compare equal in most cases is it more performance compliant to do something like the following instead of a direct string comparison? Also consider this will be in a loop reading a file so it will be executed several times which is the concern for large files.
std::string largeString1; // large but not huge meaning a line of text like up to lets say 500 chars
std::string largeString2;
// is this better than then next block in terms of performance and if so by how much?
if ( std::hash<std::string>(largeString1) == std::hash<std::string>(largeString2) )
{
// true logic
}
// is this a lot slower than the previous
if ( largeString1 == largeString2 )
{
// true logic
}