How release mode can be slower than debug mode?
-
Hello everyone,
I've created a program that reads in a .txt file (with class QFile) line by line with a while loop, and it analyzes each line with QRegEx. As these are large files, the reading takes a few time.
In debug mode, reading a 1Mb file takes one second.
In Release mode, it takes 6 seconds to read the same file.As I understand, this should normally be faster in release mode than in debug mode. But it's the opposite.
How is it possible? Do you have any idea what could cause this problem?
Kind Regards,
Mat
Windows 10/ Architecture: x86_64 / Qt Creator 4.9.1 / Based on Qt 5.12.3 (MSVC 2017, 32 bit) / Compiler: MinGW 7.3.0 64-bit for C++
-
@Mat28 said in How release mode can be slower than debbug mode?:
How is it possible? Do you have any idea what could cause this problem?
You will need to show your code where you read and parse the file, else we only can guess.
-
I thought the problem could only come from the configuration of compiler or something like this.
Finally, as you asked me for my code, I've analyze more my code and the problem was that I defined a QregExpression in the while loop.
So it's resolved.
Many thank's
Mat