Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How release mode can be slower than debug mode?

How release mode can be slower than debug mode?

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 563 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Mat28
    wrote on last edited by aha_1980
    #1

    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++

    jsulmJ 1 Reply Last reply
    0
    • M Mat28

      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++

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @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.

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      3
      • M Offline
        M Offline
        Mat28
        wrote on last edited by
        #3

        @jsulm

        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

        1 Reply Last reply
        3

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved