Page 2 of 2 FirstFirst 12
Results 21 to 38 of 38

Thread: what are the debug versions used for?!!

  1. #21
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: what are the debug versions used for?!!

    I know that when you are compiling static applications, it takes much longer to compile the application in debug mode as the resulting executable is HUGE, and seems to take sometime to write that monster to disk.

    With dynamic there's not that much difference, but I much prefer debug mode so I can just set a breakpoint and ensure the codes working as I expect it to rather than hoping it works and then finding out later that it doesn't quite work 100% and trying to figure out why.

    I subscribe to the methodology of "Get it working first, optimise it second", so I don't even bother with release mode until everything works.

  2. #22
    Join Date
    Jan 2006
    Location
    Frankfurt
    Posts
    500
    Thanks
    1
    Thanked 52 Times in 52 Posts
    Platforms
    MacOS X Unix/X11

    Default Re: what are the debug versions used for?!!

    Quote Originally Posted by FS Lover View Post
    many times just compiler error massages are sufficient to discover the cause shortly.
    i think a good programmer is so.
    Compiler error messages are to fix syntax errors while a debugger helps you to fix logic errors in your programm flow.
    It's nice to be important but it's more important to be nice.

  3. #23
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,363
    Thanks
    3
    Thanked 5,012 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: what are the debug versions used for?!!

    Quote Originally Posted by fatjuicymole View Post
    I know that when you are compiling static applications, it takes much longer to compile the application in debug mode as the resulting executable is HUGE, and seems to take sometime to write that monster to disk.
    The question is why would you want to compile debug version of the application in static mode.

    With dynamic there's not that much difference, but I much prefer debug mode so I can just set a breakpoint and ensure the codes working as I expect it to rather than hoping it works and then finding out later that it doesn't quite work 100% and trying to figure out why.
    The trouble is some apps tend to work in debug mode and fail in release mode because of the aforementioned optimizations and some extra stuff that is done in debug mode (i.e. clearing process memory before filling it with data).

    I often switch to release mode if I have to link against other release mode code (i.e. when doing Designer plugins) or when execution time is crucial (i.e. when doing networking) and debug version would fail. In my opinion there is no rule of a thumb whether you should use debug or release mode when developing an application - "it depends". Happily in Linux even the release code is (or can be) compiled with -g which allows for extra debugging information in your code.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  4. #24
    Join Date
    May 2009
    Posts
    147
    Thanks
    11
    Thanked 6 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: what are the debug versions used for?!!

    Quote Originally Posted by fatjuicymole View Post
    I know that when you are compiling static applications, it
    I know that when you are compiling static applications, it takes much longer to compile the application in debug mode as the resulting executable is HUGE, and seems to take sometime to write that monster to disk.
    ...
    With dynamic there's not that much difference
    i didn't speak about statics.
    building debug versions is considerably slower for non-static builds.
    I want to know why are you apparently an exception to this.
    I tested these on a standard P4 machine with WinXP SP2.
    e.g. an app was built in 30 secs in debug mode and 15 secs in release mode.
    please give info about your machine (CPU, RAM, OS, etc)
    maybe your machine is so powerful that times are too short for you to notice the difference.

    "Get it working first, optimise it second"
    indeed this rational methodology is for optimizing the programmer time, that my opinion about when to build release and debugs is for too.
    we can build and test debugs occasionally, and in the final stage; generally, every time we want/need!
    but not in every of many builds we do for adding/correcting simple/little/unimportant/clear things.
    Last edited by FS Lover; 16th November 2009 at 08:39.

  5. #25
    Join Date
    May 2009
    Posts
    147
    Thanks
    11
    Thanked 6 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: what are the debug versions used for?!!

    Quote Originally Posted by axeljaeger View Post
    Compiler error messages are to fix syntax errors while a debugger helps you to fix logic errors in your programm flow.
    I know.
    and we have many compiler errors while developing, that we need to solve before other things.

  6. #26
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,363
    Thanks
    3
    Thanked 5,012 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: what are the debug versions used for?!!

    Quote Originally Posted by FS Lover View Post
    building debug versions is considerably slower for non-static builds.
    I want to know why are you apparently an exception to this.
    I tested these on a standard P4 machine with WinXP SP2.
    e.g. an app was built in 30 secs in debug mode and 15 secs in release mode.
    please give info about your machine (CPU, RAM, OS, etc)
    maybe your machine is so powerful that times are too short for you to notice the difference.
    That's funny, I have a single file that compiles 4 minutes. Your machine indeed has to be strong if it compiles a whole program in 15 or 30 seconds.

    Try to find a weak spot in the logic of the above statement and then tell me why there is no logic in your statement as well.

    Another parallel: If I were living at the north pole my whole life, could I assume that on every place on Earth there is only one sunset per year?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  7. #27
    Join Date
    May 2009
    Posts
    147
    Thanks
    11
    Thanked 6 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: what are the debug versions used for?!!

    That's funny, I have a single file that compiles 4 minutes. Your machine indeed has to be strong if it compiles a whole program in 15 or 30 seconds.
    i compiled some qt's example apps of different categories.
    Try to find a weak spot in the logic of the above statement and then tell me why there is no logic in your statement as well.
    i don't see enough logic in your statements.
    for example a single file can be 10000 lines!
    show and explain more precisely if you can!
    Another parallel: If I were living at the north pole my whole life, could I assume that on every place on Earth there is only one sunset per year?
    i tested on several examples of different categories and on two machines (at home and work).
    maybe we should ask other users to test!

  8. #28
    Join Date
    May 2009
    Posts
    147
    Thanks
    11
    Thanked 6 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: what are the debug versions used for?!!

    it can be tested and proved quite practically.
    no need to discuss about theory.

  9. #29
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,363
    Thanks
    3
    Thanked 5,012 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: what are the debug versions used for?!!

    Quote Originally Posted by FS Lover View Post
    i compiled some qt's example apps of different categories.
    Which proves what exactly?

    i don't see enough logic in your statements.
    for example a single file can be 10000 lines!
    show and explain more precisely if you can!
    Exactly! Applications are different. The fact that your simple programs build faster in release more doesn't prove that applications in general tend to build faster in release mode.

    Application build process is composed from three major steps:
    1. Preprocessing source code of each module
    2. Compiling each module
    3. Linking all the modules together to form an executable binary.

    Step 1. should be equally fast in both release and debug modes.
    Step 2. is faster in debug mode because optimizations are not performed.
    Step 3. is faster in release mode because there are less symbols to resolve.

    Therefore small applications that are composed from few modules will build faster in release mode because there is little to optimize so the linking phase takes most time. Bigger and complex applications on the other hand build faster in debug mode because there is much to optimize so the linking phase becomes less significant (especially with incremental linking in debug mode). All Qt demos and examples are small programs so they fall into the first category. As I said, try building an application where a single module compiles 4 minutes (without linking) and then we can talk about things in general.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  10. #30
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: what are the debug versions used for?!!

    Whilst you are developing application you will encounter many bugs and unexpected things. If you always compile in release mode and come across one of these bugs you then have to quit the application, change to debug mode, rebuild the app, rerun and hope to get the same error quickly so you can find out why it doesn't work and fix it. I think most people will agree it would have been far easier to just set a breakpoint and fix the problem the first time you had it.

    After all, if you just want to build the application to check for syntax errors, then you can just build in the background - you don't have to wait for it to complete before moving to the next task.

    I wouldn't say my machine was that powerful, it's an AMD Dual Core 3800 with 2GB of RAM and WinXP, and I know the compiler doesn't take advantage of the second core as CPU usage never exceeds 50% during builds. A full rebuild takes about 2 minutes regardless of debug or release mode - I've not timed builds to the second, but it certainly isn't slower enough for me to notice the difference.

    I'd have to agree with wysota - the differences you are noticing are probably because the applications you are compiling are so small.

  11. #31
    Join Date
    May 2009
    Posts
    147
    Thanks
    11
    Thanked 6 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: what are the debug versions used for?!!

    Mr. wysota, please give me some real app of those so I can test to see it builds faster (or equal) in debug mode.
    maybe it's my computer that is not consistent enough with debugs
    I have qt sdk 2009.04 on windows xp (give me a source that can be compiled in this environment without any other dependency).

  12. #32
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,363
    Thanks
    3
    Thanked 5,012 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: what are the debug versions used for?!!

    Quote Originally Posted by FS Lover View Post
    Mr. wysota, please give me some real app of those so I can test to see it builds faster (or equal) in debug mode.
    http://kde.org/download/#v4.3

    I'm not here to give you anything. I don't care if you are convinced you're right or not.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  13. #33
    Join Date
    May 2009
    Posts
    147
    Thanks
    11
    Thanked 6 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default

    Quote Originally Posted by wysota View Post
    what do u mean?
    it should be just a standard app for windows.

    I'm not here to give you anything. I don't care if you are convinced you're right or not.
    it's not about giving anything to or convincing me.
    it's about examining a quite practical matter practically.
    Last edited by wysota; 25th November 2009 at 08:56.

  14. #34
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: what are the debug versions used for?!!

    You can't take a single application and say whether Debug or Release will compile faster, as it will always depend on the application. You will have to take several applications from different authors and for different purposes and compile them, then take the average. You will also need to take into account projects which have precompiled headers enabled and ones which do not.

    Or, you could use what you prefer. I prefer to compile in Debug mode as it makes things easier for me. If you prefer Release mode then use that. We are not here to say you must use one way or the other - it's totally up to you.

  15. #35
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,363
    Thanks
    3
    Thanked 5,012 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: what are the debug versions used for?!!

    Quote Originally Posted by FS Lover View Post
    what do u mean?
    it should be just a standard app for windows.
    Then build it for Windows. And if you can't then make an effort and build it for Linux. Even if you don't have one, installing a Linux virtual machine is just half an hour of work at most.

    it's about examining a quite practical matter practically.
    If you don't see anything practical in debugging - I don't care. Use any means of debugging you see fit and those that work for you best.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  16. #36
    Join Date
    May 2009
    Posts
    147
    Thanks
    11
    Thanked 6 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: what are the debug versions used for?!!

    Then build it for Windows. And if you can't then make an effort and build it for Linux. Even if you don't have one, installing a Linux virtual machine is just half an hour of work at most.
    I assume you failed to prove the matter practically (I know you don't care ).
    I just wanted an ordinary app, like many other apps programmers work with most of their times.

    If you don't see anything practical in debugging - I don't care. Use any means of debugging you see fit and those that work for you best.
    you don't care
    I don't care that you don't care
    we were talking about another aspects, not about whether debugging facilities matter or not.
    we were talking about whether building in debug mode is slower than release mode (and how much) or not.
    and about how to optimize the programmer's time by reducing frequent compilation times, that depends on the above issue and how often in every compilation we need to use debugging facilities, and other possible parameters.

  17. #37
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: what are the debug versions used for?!!

    Surely your capable of finding your own application - you don't have to wait for someone to hand one to you on a plate, so to speak?

    Go and find some apps, compile them, post your results. Don't just complain about why other people are not doing your work for you when they are not the ones with the problem.

  18. #38
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,363
    Thanks
    3
    Thanked 5,012 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: what are the debug versions used for?!!

    You can try Avogadro, it's probably "complex enough".
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Need debug and release versions of Qwt?
    By Tiansen in forum Qwt
    Replies: 1
    Last Post: 28th March 2008, 07:55
  2. Some very weird compilation warnings
    By MarkoSan in forum Qt Programming
    Replies: 21
    Last Post: 23rd January 2008, 16:48
  3. Adding custom defines when on debug build
    By chus in forum Qt Programming
    Replies: 2
    Last Post: 2nd March 2007, 11:38
  4. Replies: 11
    Last Post: 22nd March 2006, 19:06

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.