Hello
I was trying to debug a program with Visual Studio 2019 v142 with 10.0.19041.0 SDK, C++17 Standard
stepping through lines is ok but it's clearly slower at the execution of loops with many iterations such as this:
ifstream in("text.txt");
vector <string > words_to_find= {"apple", "monkey"};
vector <pair<string, int>> matches;
string line;
while (getline(in, line))
{
for (int g = 0; g < words_to_find.size(); g++)
{
int ret = line.find(words_to_find[g]);
if (ret != string::npos)
{
matches.push_back({words_to_find[g], (int)in.tellg()} );
}
}
}
to complete the loop the debug version takes 14 seconds and the release version 2.5 seconds, and it's the same even if i just run the executables from a normal command line
any help?
thanks