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. Speed Optimization of C++ console application

Speed Optimization of C++ console application

Scheduled Pinned Locked Moved Solved General and Desktop
25 Posts 10 Posters 4.8k Views
  • 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.
  • K Kent-Dorfman
    16 Dec 2019, 22:27

    @kshegunov I wrote absolutely nothing about "-g". I still maintain that simple -O0 vs -O2 is NOT going to divide performance by a factor of 10. I cannot begin to imagine how badly a person would have to design their algorithm to validate that level of performance hit. something other than compiler optimization is causing his hit...

    K Offline
    K Offline
    kshegunov
    Moderators
    wrote on 17 Dec 2019, 21:18 last edited by kshegunov
    #21

    @Kent-Dorfman said in Speed Optimization of C++ console application:

    @kshegunov I wrote absolutely nothing about "-g".

    Fair enough.

    I still maintain that simple -O0 vs -O2 is NOT going to divide performance by a factor of 10. I cannot begin to imagine how badly a person would have to design their algorithm to validate that level of performance hit.

    https://bitbucket.org/kshegunov/ans-utilities/src/master/hermite/

    Knock yourself out, if you so desire. I'm certainly not investing the time to see if -g makes a significant difference, which I strongly suspect it doesn't.

    Read and abide by the Qt Code of Conduct

    1 Reply Last reply
    1
    • K Kent-Dorfman
      16 Dec 2019, 22:27

      @kshegunov I wrote absolutely nothing about "-g". I still maintain that simple -O0 vs -O2 is NOT going to divide performance by a factor of 10. I cannot begin to imagine how badly a person would have to design their algorithm to validate that level of performance hit. something other than compiler optimization is causing his hit...

      A Offline
      A Offline
      aha_1980
      Lifetime Qt Champion
      wrote on 18 Dec 2019, 07:35 last edited by
      #22

      @Kent-Dorfman said in Speed Optimization of C++ console application:

      @kshegunov I wrote absolutely nothing about "-g". I still maintain that simple -O0 vs -O2 is NOT going to divide performance by a factor of 10. I cannot begin to imagine how badly a person would have to design their algorithm to validate that level of performance hit. something other than compiler optimization is causing his hit...

      That strongly depends on the algorightm, I'd say.

      Just imagine, a non optimized build that does not fit in the cache, so the CPU has to re-load stuff from memory all the time vs. the optimized build that runs fluently.

      Factor 10 is probably not the normal case where you have to wait for I/O anyway, but for heavy computing it is easily possible.

      Regards

      Qt has to stay free or it will die.

      1 Reply Last reply
      0
      • F Offline
        F Offline
        fcarney
        wrote on 18 Dec 2019, 15:20 last edited by
        #23

        This is starting to sound like a coding challenge. Can you write an algorithm that is slow the compiler can optimize and make fast? Like turning lead to gold.

        C++ is a perfectly valid school of magic.

        K 1 Reply Last reply 18 Dec 2019, 15:29
        2
        • F fcarney
          18 Dec 2019, 15:20

          This is starting to sound like a coding challenge. Can you write an algorithm that is slow the compiler can optimize and make fast? Like turning lead to gold.

          K Offline
          K Offline
          kshegunov
          Moderators
          wrote on 18 Dec 2019, 15:29 last edited by
          #24

          @fcarney said in Speed Optimization of C++ console application:

          Can you write an algorithm that is slow the compiler can optimize and make fast? Like turning lead to gold.

          As I wrote, any template nonsense you have (the deeper and nastier the better) fits into this category.

          Read and abide by the Qt Code of Conduct

          1 Reply Last reply
          0
          • K Offline
            K Offline
            Kent-Dorfman
            wrote on 19 Dec 2019, 22:53 last edited by
            #25

            Eh, the OP kind of disappeared so I guess it isn't that important to him. I'm more interested in knowing whether the windoze version in this exercise was compiled to CLR bytecode, which he never answered, and which IMHO invalidates any real comparison.

            1 Reply Last reply
            0

            21/25

            17 Dec 2019, 21:18

            • Login

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