Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 37097
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T14:29:50+00:00 2026-05-10T14:29:50+00:00

Do you normally set your compiler to optimize for maximum speed or smallest code

  • 0

Do you normally set your compiler to optimize for maximum speed or smallest code size? or do you manually configure individual optimization settings? Why?

I notice most of the time people tend to just leave compiler optimization settings to their default state, which with visual c++ means max speed. I’ve always felt that the default settings had more to do with looking good on benchmarks, which tend to be small programs that will fit entirely within the L2 cache than what’s best for overall performance, so I normally set it optimize for smallest size.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T14:29:50+00:00Added an answer on May 10, 2026 at 2:29 pm

    As a Gentoo user I have tried quite a few optimizations on the complete OS and there have been endless discussions on the Gentoo forums about it. Some good flags for GCC can be found in the wiki.

    In short, optimizing for size worked best on an old Pentium3 laptop with limited ram, but on my main desktop machine with a Core2Duo, -O2 gave better results over all.

    There’s also a small script if you are interested in the x86 (32 bit) specific flags that are the most optimized.

    If you use gcc and really want to optimize a specific application, try ACOVEA. It runs a set of benchmarks, then recompile them with all possible combinations of compile flags. There’s an example using Huffman encoding on the site (lower is better):

    A relative graph of fitnesses:     Acovea Best-of-the-Best: **************************************                (2.55366)      Acovea Common Options: *******************************************           (2.86788)                        -O1: **********************************************        (3.0752)                        -O2: ***********************************************       (3.12343)                        -O3: ***********************************************       (3.1277)            -O3 -ffast-math: **************************************************    (3.31539)                        -Os: *************************************************     (3.30573) 

    (Note that it found -Os to be the slowest on this Opteron system.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

To use your own ModelMetadataProvider you normally set it in the global.asax. I'm using
Normally when using Lucene you set a search query and Lucene gives you some
Normally with Java Swing you can set the background color of a button with:
Normally when I want to query large result set using Mysql I write this
Normally, when tabbing through controls on a form, when the focus is set to
I normally save new data to the database like this: $this->MyTable->set(array( 'id' => $id,
If I have a table of a hundred users normally I would just set
Normally, Rails stores all times in the database in UTC time. If you set
Normally is it good practice to set all database columns as NOT NULL or
Normally, you can change the default root drive to install your application to using:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.