Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Special Interest Groups
  3. C++ Gurus
  4. Performance difference
Qt 6.11 is out! See what's new in the release blog

Performance difference

Scheduled Pinned Locked Moved Solved C++ Gurus
22 Posts 3 Posters 16.3k 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.
  • JonBJ JonB

    @Chris-Kawa
    You are going over the top IMHO! Not optimizing is not that bad, despite what you say. I cannot comment on, say, STL in MSVC. Our apps are I/O bound in system code, file handling, database access etc., so local optimization (of our own code) is not going to be that significant over the whole experience.

    Your points are valid, but they do not address the reality of what we found: your code can be as optimized as you feel like, but that's useless if we/the user cannot trust the code because of empirical observation of bugged code generation under compiler optimization. Being burnt all those years ago has left a fear that perhaps you have never experienced.

    If I ever rethought the situation (you are inspiring me now!) I guess I would give optimization a go now. You are saying that you can guarantee that e.g. MSVC will not have a single bug in optimized code generated? Serious question.

    Chris KawaC Offline
    Chris KawaC Offline
    Chris Kawa
    Lifetime Qt Champion
    wrote on last edited by Chris Kawa
    #12

    You are going over the top! Not optimizing is not that bad

    Yes, yes it is. The user visible impact might not be that severe in some types of apps but the underlying waste is unquestionable. In particular cases, like gaming, it can drop a game from 120 frames per second to the lower 20s.

    Being burnt all those years ago has left a fear that perhaps you have never experienced.

    A horse looked at me the wrong way 20 years ago so i don't use cars and walk everywhere.

    You are saying that you can guarantee that e.g. MSVC will not have a single bug in optimized code generated?

    No, I can't guarantee that for any existing software. I can guarantee that config used by millions of apps will be better tested than config used by dozens.

    Serious question.

    Serious answer then - I'd bet that if you turned on optimization after years of not using them your software would crash a lot, finding bugs you didn't even knew were there. Debug builds for example zero out memory before use so you can be sure you have garbage pointers lurking if you don't do release builds. Threading and synchronization is another area where unoptimized builds tend to mask a lot of problems, because they just run slower and you don't see races that often.

    JonBJ 1 Reply Last reply
    5
    • Chris KawaC Chris Kawa

      You are going over the top! Not optimizing is not that bad

      Yes, yes it is. The user visible impact might not be that severe in some types of apps but the underlying waste is unquestionable. In particular cases, like gaming, it can drop a game from 120 frames per second to the lower 20s.

      Being burnt all those years ago has left a fear that perhaps you have never experienced.

      A horse looked at me the wrong way 20 years ago so i don't use cars and walk everywhere.

      You are saying that you can guarantee that e.g. MSVC will not have a single bug in optimized code generated?

      No, I can't guarantee that for any existing software. I can guarantee that config used by millions of apps will be better tested than config used by dozens.

      Serious question.

      Serious answer then - I'd bet that if you turned on optimization after years of not using them your software would crash a lot, finding bugs you didn't even knew were there. Debug builds for example zero out memory before use so you can be sure you have garbage pointers lurking if you don't do release builds. Threading and synchronization is another area where unoptimized builds tend to mask a lot of problems, because they just run slower and you don't see races that often.

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by JonB
      #13

      @Chris-Kawa
      I respect what you suggest, and am grateful for food for thought/your experiences. (And, yes, if I were releasing a game/frame-rate-critical app the situation would be different.) Just to be clear, I did not say we release "debug" builds, I said we release compiling/linking not for debug (e.g. so no memory zeroing, nor memory debug functions, nor debug libraries) but equally not with any optimization (-O...) compilation.

      A horse looked at me the wrong way 20 years ago so i don't use cars and walk everywhere.

      Yep, I don't use horses ;-)

      Purely, purely OOI: is whatever software you develop used in-house, or is it sold to external customers where you cannot replicate their environment?

      Chris KawaC 1 Reply Last reply
      1
      • JonBJ JonB

        @Chris-Kawa
        I respect what you suggest, and am grateful for food for thought/your experiences. (And, yes, if I were releasing a game/frame-rate-critical app the situation would be different.) Just to be clear, I did not say we release "debug" builds, I said we release compiling/linking not for debug (e.g. so no memory zeroing, nor memory debug functions, nor debug libraries) but equally not with any optimization (-O...) compilation.

        A horse looked at me the wrong way 20 years ago so i don't use cars and walk everywhere.

        Yep, I don't use horses ;-)

        Purely, purely OOI: is whatever software you develop used in-house, or is it sold to external customers where you cannot replicate their environment?

        Chris KawaC Offline
        Chris KawaC Offline
        Chris Kawa
        Lifetime Qt Champion
        wrote on last edited by
        #14

        is whatever software you develop used in-house, or is it sold to external customers where you cannot replicate their environment?

        I'm a game developer so both. We do in-house tools, big and small, think from Notepad to Photoshop size, used by few hundreds of people locally at their stations and on a set of servers, and then the game itself goes to all sorts of PCs and consoles across millions of players around the world so a very diverse set of hardware and software configurations.

        JonBJ 1 Reply Last reply
        1
        • Chris KawaC Chris Kawa

          is whatever software you develop used in-house, or is it sold to external customers where you cannot replicate their environment?

          I'm a game developer so both. We do in-house tools, big and small, think from Notepad to Photoshop size, used by few hundreds of people locally at their stations and on a set of servers, and then the game itself goes to all sorts of PCs and consoles across millions of players around the world so a very diverse set of hardware and software configurations.

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote on last edited by JonB
          #15

          @Chris-Kawa
          Yeah, a rather different situation from us, "mission critical".

          Final question: now that you know I am not saying we release with any debug compilation/libraries/anything (which I agree would be terrible), only that we do not compile our own code with -O..., [plus it's not a game] are you willing to relax your condemnation a little, or am I still going to Hell in a handbasket? :)

          Chris KawaC 1 Reply Last reply
          1
          • JonBJ JonB

            @Chris-Kawa
            Yeah, a rather different situation from us, "mission critical".

            Final question: now that you know I am not saying we release with any debug compilation/libraries/anything (which I agree would be terrible), only that we do not compile our own code with -O..., [plus it's not a game] are you willing to relax your condemnation a little, or am I still going to Hell in a handbasket? :)

            Chris KawaC Offline
            Chris KawaC Offline
            Chris Kawa
            Lifetime Qt Champion
            wrote on last edited by Chris Kawa
            #16

            a rather different situation from us, "mission critical".

            We "release" tools almost daily so If I cause a crash a large group of people can't do their work and that costs, so it's pretty mission critical too, although not life threatening. Well, maybe just mine when those angry people come to me :)

            If you're under some regulations then it's not on you. I know there are industries where changing a configuration can mean a year of retesting, reapproving and certification. A lot of aviation for example still uses languages and compilers from the 70s because of that fact. If your software can kill a patient because you flipped a flag then it definitely should not be an ad hoc decision.

            are you willing to relax your condemnation a little, or am I still going to Hell?

            I'm not saying you're going to hell. I'm just saying you're gonna have a lot of regrets lying on your death bed ;) White bears drowning, bees vanishing, Australia burning, all that life people wasted waiting for your software to finish...

            It's just a waste, that's all. A thing that can be done in microsecond you do in three. Nothing more, nothing less. It's the same as throwing out garbage on the pavement - it's not a world ending event, but how you feel about it is up to you.

            JonBJ 1 Reply Last reply
            5
            • D Offline
              D Offline
              damianatorrpm
              wrote on last edited by
              #17

              For me the question is most OOI.

              While writing code I try to always choose the best solution,
              while this is not always possible, stuff like this is rarely documented and
              consistent so I appreciate everyone responding. You learn new stuff every day!

              1 Reply Last reply
              0
              • Chris KawaC Chris Kawa

                a rather different situation from us, "mission critical".

                We "release" tools almost daily so If I cause a crash a large group of people can't do their work and that costs, so it's pretty mission critical too, although not life threatening. Well, maybe just mine when those angry people come to me :)

                If you're under some regulations then it's not on you. I know there are industries where changing a configuration can mean a year of retesting, reapproving and certification. A lot of aviation for example still uses languages and compilers from the 70s because of that fact. If your software can kill a patient because you flipped a flag then it definitely should not be an ad hoc decision.

                are you willing to relax your condemnation a little, or am I still going to Hell?

                I'm not saying you're going to hell. I'm just saying you're gonna have a lot of regrets lying on your death bed ;) White bears drowning, bees vanishing, Australia burning, all that life people wasted waiting for your software to finish...

                It's just a waste, that's all. A thing that can be done in microsecond you do in three. Nothing more, nothing less. It's the same as throwing out garbage on the pavement - it's not a world ending event, but how you feel about it is up to you.

                JonBJ Offline
                JonBJ Offline
                JonB
                wrote on last edited by
                #18

                @Chris-Kawa said in Performance difference:

                I'm just saying you're gonna have a lot of regrets lying on your death bed ;)

                Believe me, one thing I will not be thinking about/regretting on my deathbed is whether I did or did not switch on a compiler optimization flag ;-)

                Chris KawaC 1 Reply Last reply
                0
                • JonBJ JonB

                  @Chris-Kawa said in Performance difference:

                  I'm just saying you're gonna have a lot of regrets lying on your death bed ;)

                  Believe me, one thing I will not be thinking about/regretting on my deathbed is whether I did or did not switch on a compiler optimization flag ;-)

                  Chris KawaC Offline
                  Chris KawaC Offline
                  Chris Kawa
                  Lifetime Qt Champion
                  wrote on last edited by
                  #19

                  @JonB It doesn't happen often but one switch can sometimes change the world. Anyways, I'm happy to see you confident in your future predicting abilities. Fingers crossed you're right.

                  JonBJ 1 Reply Last reply
                  0
                  • Chris KawaC Chris Kawa

                    @JonB It doesn't happen often but one switch can sometimes change the world. Anyways, I'm happy to see you confident in your future predicting abilities. Fingers crossed you're right.

                    JonBJ Offline
                    JonBJ Offline
                    JonB
                    wrote on last edited by
                    #20

                    @Chris-Kawa
                    With your surname, are you from down-under?

                    Chris KawaC 1 Reply Last reply
                    0
                    • JonBJ JonB

                      @Chris-Kawa
                      With your surname, are you from down-under?

                      Chris KawaC Offline
                      Chris KawaC Offline
                      Chris Kawa
                      Lifetime Qt Champion
                      wrote on last edited by
                      #21

                      @JonB Not sure what you mean. My last name is Polish and translates to coffee, which reminds me I'm up for a break :) Have a nice day.

                      JonBJ 1 Reply Last reply
                      1
                      • Chris KawaC Chris Kawa

                        @JonB Not sure what you mean. My last name is Polish and translates to coffee, which reminds me I'm up for a break :) Have a nice day.

                        JonBJ Offline
                        JonBJ Offline
                        JonB
                        wrote on last edited by
                        #22

                        @Chris-Kawa
                        It looked a bit like "Kiwi" to me, I was way off. "("Down-under" means Australia or New Zealand.) It may be wasted on you, but the one thing I was thinking I might regret on my deathbed is that Kylie never chose to marry me. I do not believe that is because she is disappointed that I did not use compiler optimizations ;-) All the best :)

                        1 Reply Last reply
                        1

                        • Login

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