Discussion:
Optimization Settings for inlining (GUI 2005)?
(too old to reply)
Martin B.
2009-10-21 11:44:09 UTC
Permalink
Hi all.

In Visual Studio 2005 I have the following Optimization settings:
- Optimization: /Od | /O1 | /O2 | /Ox | "Custom"
- Inline Functions: "Default" | /Ob1 | /Ob2
- ...

My problem is now, if I want inlining *only*, should I set the general
setting to /Od or to "Custom" (which results in no cmdline switch)??
That is: Both {/Od /Ob2} or {/Ob2} only?

cheers,
Martin
David Lowndes
2009-10-21 13:39:29 UTC
Permalink
Post by Martin B.
- Optimization: /Od | /O1 | /O2 | /Ox | "Custom"
- Inline Functions: "Default" | /Ob1 | /Ob2
- ...
My problem is now, if I want inlining *only*, should I set the general
setting to /Od or to "Custom" (which results in no cmdline switch)??
That is: Both {/Od /Ob2} or {/Ob2} only?
Martin,

/Od is defined as the default, so I wouldn't expect it to matter. Have
you tried both to see what the effect is?

Dave
Carl Daniel [VC++ MVP]
2009-10-21 14:02:30 UTC
Permalink
Post by Martin B.
Hi all.
- Optimization: /Od | /O1 | /O2 | /Ox | "Custom"
- Inline Functions: "Default" | /Ob1 | /Ob2
- ...
My problem is now, if I want inlining *only*, should I set the general
setting to /Od or to "Custom" (which results in no cmdline switch)??
That is: Both {/Od /Ob2} or {/Ob2} only?
Use only /Ob2. Using /Od disables optimization - I don't know whether it
supercedes other options that specifically enable certion optimizations, or
if it does, if the order in which the comman line arguments appear is of any
significance (e.g. /Od /Ob2 might inline while /Ob2 /Od wouldn't). Rather
than depend on something that subtle, I'd just use /Ob2 by itself.

-cd
Bo Persson
2009-10-21 15:21:08 UTC
Permalink
Post by Martin B.
Hi all.
- Optimization: /Od | /O1 | /O2 | /Ox | "Custom"
- Inline Functions: "Default" | /Ob1 | /Ob2
- ...
My problem is now, if I want inlining *only*, should I set the
general setting to /Od or to "Custom" (which results in no cmdline
switch)?? That is: Both {/Od /Ob2} or {/Ob2} only?
I'm just curious about WHY you would want that? :-)


Bo Persson
Martin B.
2009-10-22 06:19:44 UTC
Permalink
Post by Bo Persson
Post by Martin B.
Hi all.
- Optimization: /Od | /O1 | /O2 | /Ox | "Custom"
- Inline Functions: "Default" | /Ob1 | /Ob2
- ...
My problem is now, if I want inlining *only*, should I set the
general setting to /Od or to "Custom" (which results in no cmdline
switch)?? That is: Both {/Od /Ob2} or {/Ob2} only?
I'm just curious about WHY you would want that? :-)
The combinations become important when you have projects that inherit
different common property sheets (.vsprops files)


FWIW, I have tried with a simple test project and it appears that {/Od
/Ob2} and only {/Ob2} do the same thing, that is, function inlining is
enabled.


br,
Martin

Loading...