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

  • SEARCH
  • Home
  • 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 8631547
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T09:14:03+00:00 2026-06-12T09:14:03+00:00

We have a very large program here which mixes C++ and FORTRAN (sorry). One

  • 0

We have a very large program here which mixes C++ and FORTRAN (sorry). One of my check-ins has resulted in a dramatic slowdown of the complete application (i.e. by a factor of two or more) – even in areas of the code which are not affected by my changes.

The facts:

  1. Almost every module has slowed by a similar amount – even ones which use none of my code.

  2. The executable is about 6% bigger.

  3. The metadata has not been changed between check-ins.

  4. The IDE/compiler is VS2010 in Release mode.

  5. Some .lib files have doubled or tripled in size.

I looked at one of the .lib files which has tripled in size, and there are only two changes:

a) I have included a large-ish header file which in turn includes many others – some of which contain moderately complicated inline code. The ‘Additional Include Directories’ has gone from none-or-one to about 7, as each header file #includes one or more others.

b) I have called 4 functions from out of this header file, but these are not called during the run that has slowed down (i.e. their execution cannot be slowing the code down, but their inclusion might conceivably be).

In spite of searching the forums as to whether including header files slows down execution (as opposed to compilation), I can’t find a single relevant article. My questions are:

? Does the #inclusion of any form of header (declaration or inline) slow down the code execution?

? Is there are qualitative or quantitative difference in the inclusion of inline code w.r.t. execution speed (I know that ‘inline’ is only advice to the compiler)?

? What are the correlations between .lib size, .exe size and execution speed (I’m expecting lots of different and contradictory correlations here)?

? Will refactoring some of the header files such that they don’t need to include others (by putting these includes into a .cpp file, and thus reducing my ‘Additional Include Directories’) improve my situation, do you think?

I guess the last question is the meat of the issue, as it will take a lot of effort…

  • 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. Editorial Team
    Editorial Team
    2026-06-12T09:14:04+00:00Added an answer on June 12, 2026 at 9:14 am

    Does the #inclusion of any form of header (declaration or inline) slow down the code execution?

    Adding unused declarations nor adding unused inline definitions does not slow down execution. I can however imagine several things that can slow down execution:

    • Some #define that prevents optimized inline or macro variants of commonly used functions to be provided by another header further down the line.
    • Overload for some operation that is commonly used, possibly from within standard library, that is less efficient than the default.

    Is there are qualitative or quantitative difference in the inclusion of inline code w.r.t. execution speed (I know that ‘inline’ is only advice to the compiler)?

    Well, if the code is not available, it can’t be inlined. If it is, that it can. Usually the compiler can estimate how much inlining will save and not inline if it won’t help, but occasionally it can guess wrong. In such case the result will be wildly different from the usual case where it slightly helps.

    What are the correlations between .lib size, .exe size and execution speed (I’m expecting lots of different and contradictory correlations here)?

    Completely different case by case. Inlining inflates the code size, but can save a lot of work on each call site. But larger code takes up more cache, which slows it down.

    Will refactoring some of the header files such that they don’t need to include others (by putting these includes into a .cpp file, and thus reducing my ‘Additional Include Directories’) improve my situation, do you think?

    It may or may not. Depends on the actual cause.

    I propose you should really try to find the cause. It is almost certainly caused by some particular bit of code, not the amount of code included. So go back to revision before the change and add the included bit by bit. First include the innermost headers alone and than add the headers that use them and so on, one by one. When you get to the particular header that makes things worse, try commenting out bits of it until you narrow it down to particular declaration or few of them.

    Also take out just some function where you observe the performance degradation. Than if you narrow it down and still don’t see what could be wrong, you’ll have something on that others can reproduce the issue, so you can use it as new question.

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

Sidebar

Related Questions

I have a very large program which I have been compiling under visual studio
I have a very large XML file which has like 40000 data, and when
I'm scratching my head here... I have a large program which I've written in
Have a very large program where there is always a superview that just encompasses
I am indexing a set of websites which have a very large number of
Here is a hypotetical scenario. I have very large number of user names (say
I have a simple program which reads a large file containing few million rows,
I have a very large text file, and my iPad program needs to occasionally
I have a very large Excel sheet converted from a 6000 page PDF file,
I have a very large UIView approx 3000x3000 in size. In this large view

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.