Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. How to favor speed over size?
Forum Updated to NodeBB v4.3 + New Features

How to favor speed over size?

Scheduled Pinned Locked Moved Installation and Deployment
4 Posts 3 Posters 2.5k 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.
  • F Offline
    F Offline
    floatingWoods
    wrote on last edited by
    #1

    Hello,

    I am wondering if there is a project file command that allows to generate faster code? I am using QtCreator 2.3.1 under Windows, and compiling with MingW or MSVC2005.

    Or is there a configuration file that I can edit to specify additional commands? E.g. for the MSVC2005 compiler, I could specify switches like "/O2", "/Ob2", "/Oi" or "/Ot", but where could I add those switches?

    ( I added following line to my project file, but this doesn't make a difference it seems: "CONFIG += fast" )

    Thanks for any insight

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      Take a look at "LINK":http://developer.qt.nokia.com/doc/qt-4.8/qmake-variable-reference.html, especially at "QMAKE_CXX":http://developer.qt.nokia.com/doc/qt-4.8/qmake-variable-reference.html#id-729b5fe0-bf39-49b5-9cc8-f89aeff3d67a family of variables.

      (Z(:^

      1 Reply Last reply
      0
      • G Offline
        G Offline
        goetz
        wrote on last edited by
        #3

        The release configuration for MinGW and MSVC adds

        @
        QMAKE_CFLAGS_RELEASE = -O2
        @

        This is a sane default for speed optimizations. Unless you do number crunching or similar stuff that turns your CPU into a radiator, it's rarely necessary to change this.

        http://www.catb.org/~esr/faqs/smart-questions.html

        1 Reply Last reply
        0
        • F Offline
          F Offline
          floatingWoods
          wrote on last edited by
          #4

          Thanks to both of you!
          I am actually turning my CPU into a radiator since it is about heavy calculations, so I am using following settings for maximum speed:

          CONFIG += fast
          QMAKE_CXXFLAGS_RELEASE += -O2
          QMAKE_CXXFLAGS_RELEASE += -Ob2
          QMAKE_CXXFLAGS_RELEASE += -Oi
          QMAKE_CXXFLAGS_RELEASE += -Ot
          QMAKE_CXXFLAGS_RELEASE += -GL

          Not sure though if the "CONFIG += fast" is needed or has an effect whatsoever.

          Cheers

          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 Extensions
          • Unsolved