I strongly suspect that you are comparing apples to oranges.
Were you a compiler with exactly the same compiler, the same compilation flag and creating an application with the same functionality?
If so, parse the executable and see what the additional code is.
My guess is that this is some one-time library used to support C ++ functions that have not been used before.
But, as always, do not guess, measure.
You have one data point. This does not tell you. We could look at a 350% increase in file size in all cases, or we could look at fixed 16K overhead. You need to find out what it is. So get some more data points. Extend your application. Make it open ten windows instead of one, or add additional features in some other way. is your version three times as large in this case? Or is it 16kb more? Or somewhere in the middle? Get a few more data points and you can see how the file size scales.
But most likely you are not worried for several reasons:
- the C ++ compiler treats inline as a hint. You simplify the built-in function for the compiler, but the decision belongs to the compiler itself, and it tries to make the application quickly. If the file size starts to get out of hand, this will slow down your code, so your compiler will try to optimize more towards a smaller file size.
- you look at a couple of kilobytes. In the era of terabyte hard drives. If this can be a problem, you should be able to provoke this problem in a test case. If you can not write a test that will increase the file size by more than 16 kilobytes, then this is not worth the worry.
- If file size becomes a problem, compilers usually have the "optimize for size" flag.
- large executables usually get their size because they contain a lot of data and resources. The code itself is very rarely a problem (unless you become completely funkers with metaprogramming templates)
source share