Compiling as debugging in qt sets the -DQT_NO_DEBUG flag for one thing in a compiler call, which is used in many qt libraries. As Jimmy has already pointed out, the main difference in performance comes from this source. One extreme example is the use of a debug version of STL containers that can be used to check boundaries. If this is used in your code in debug mode, things can take a lot of time (Qt does not use this, but introduces similar checks in its libraries).
In addition, optimization flags are usually changed. For release, -O2 is selected for release and is not optimized for debugging.
Another important thing in debug builds is that you can use it to run various things in a pro file, such as adding definitions, changing a target, or compiling with respect to another set of libraries:
CONFIG(debug, debug|release) { message("Debug") DESTDIR = $$DESTDIR-debug CONFIG += debug DEFINES += DEBUG TARGET = $$TARGET-debug }else{ message("Release") DEFINES += QT_NO_DEBUG_OUTPUT DESTDIR = $$DESTDIR-release TARGET = $$TARGET-release }
If you are interested in more details, see the qmake configuration files. Linux Ubuntu: / usr / share / qt4 / mkspecs / common / g ++. Conf / usr / share / qt4 / mkspecs / common / linux.conf and client dependent conf
source share