Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
qtws26_logo

The Qt Event of the Year: Qt World Summit 2026

Save Your Spot >
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Do qDebug statements degrade app performance? - Qt
Qt 6.12 LTS is out! See what's new in the release blog

Do qDebug statements degrade app performance? - Qt

Scheduled Pinned Locked Moved Mobile and Embedded
8 Posts 5 Posters 4.9k Views 1 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    Hi,

    I have lot of debug statements in my Qt project. The app randomly hangs and crashes. I was wondering if the qDebug statements are degrading the app performance in any manner.

    Please suggest.

    Thanks

    1 Reply Last reply
    0
    • ? Offline
      ? Offline
      A Former User
      wrote on last edited by
      #2

      I've never had problems with qDebug at all.

      Are you sure the app isn't crashing because of bad pointers?

      1 Reply Last reply
      0
      • ? Offline
        ? Offline
        A Former User
        wrote on last edited by
        #3

        Actually i am not. Its the most likely cause but just wanted to be sure about qDebug statements. Thanks

        1 Reply Last reply
        0
        • G Offline
          G Offline
          giesbert
          wrote on last edited by
          #4

          qDebug statements will surely slow down the app, as all tracing / debugging statements do.
          But it should not be significally.
          If the debug statement crashes, it is typically a wrong statement or a wrong parameter.

          Nokia Certified Qt Specialist.
          Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

          1 Reply Last reply
          0
          • ? Offline
            ? Offline
            A Former User
            wrote on last edited by
            #5

            Thanks Gerolf but do they even execute when I am using the app on the phone while I am not debugging?

            1 Reply Last reply
            0
            • G Offline
              G Offline
              giesbert
              wrote on last edited by
              #6

              They execute when you build your app with debug support enabled. As I don't know, how you build for the phone, I can't tell you.
              If debugging is disabled, they result in NOPs.

              Nokia Certified Qt Specialist.
              Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

              1 Reply Last reply
              0
              • ? Offline
                ? Offline
                A Former User
                wrote on last edited by
                #7

                They execute even if you build your app in release mode. You can even reroute output using qInstallMsgHandler() to write it in file, or send it through network, etc...

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  Hi,

                  You can define QT_NO_DEBUG_OUTPUT before compiling so that qDebug does nothing

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  0

                  • Login

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