Results 1 to 7 of 7

Thread: g++ optimization

  1. #1
    Join Date
    Jul 2007
    Posts
    57
    Thanks
    7
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default g++ optimization

    I hav developed an application which needs to be further optimized ..Memory and execution time is the constraint...Can anybody suggest some of the g++ options that can be used to optimize the execution time of the application..

  2. #2
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: g++ optimization

    g++ has a few level of optimizations.
    Try and compile with -O3.
    Also there is a flag for fast math( -ffast-math ), but I don't know if there is an accuracy trade off.

    Make sure you use set the -march option to a model that is closer to what you got.

    Regards

  3. #3
    Join Date
    Jul 2007
    Posts
    57
    Thanks
    7
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: g++ optimization

    Is it possible to use march option for an application which need to executed on a device.Any ideas

  4. #4
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: g++ optimization

    Take a look at this, since you did not specified the architecture.
    http://gcc.gnu.org/onlinedocs/gcc/Su...bmodel-Options

    Regards

  5. #5
    Join Date
    Mar 2006
    Location
    The Netherlands
    Posts
    300
    Thanks
    9
    Thanked 29 Times in 29 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: g++ optimization

    The march option optimizes for a specific architecture. If you want the application to run quickly on any architecture, don't specify that option.
    "The strength of a civilization is not measured by its ability to wage wars, but rather by its ability to prevent them." - Gene Roddenberry

  6. #6
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: g++ optimization

    Quote Originally Posted by Michiel View Post
    The march option optimizes for a specific architecture. If you want the application to run quickly on any architecture, don't specify that option.
    Well, he was asking about a single device, so it is a pretty good idea to compile it for that specific architecture.

    Regards

  7. #7
    Join Date
    Aug 2012
    Posts
    13
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: g++ optimization

    Excuse me, could you teach me how to compile with -O3? Where can i set it?

Similar Threads

  1. Need Qt Optimization for 32MB ram Machine
    By rajeshs in forum Qt Programming
    Replies: 5
    Last Post: 27th July 2007, 05:56
  2. Optimization specifics with qmake
    By bitChanger in forum Qt Programming
    Replies: 1
    Last Post: 29th August 2006, 17:55
  3. qt network performance
    By criss in forum Qt Programming
    Replies: 16
    Last Post: 24th July 2006, 09:23

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.