472,377 Members | 1,661 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,377 software developers and data experts.

Optimizing with 2003 .NET

A little confusing with setting up optimizing options with 2003 .NET.
Under the Optimization Tab. if you set to /O1 or /O2 is the program ignoring
the settings for Inline Function expansion, Enabling of Intrinsic?
Would seem these should be greyed out to let you know.

Bigger question is what have people found in setting up the optimizing?
Using /O1 or /O2 ? Any ideas would be greatly appreciated.
Nov 17 '05 #1
4 1377
Flashman wrote:
A little confusing with setting up optimizing options with 2003 .NET.
Under the Optimization Tab. if you set to /O1 or /O2 is the program
ignoring the settings for Inline Function expansion, Enabling of
Intrinsic?
Would seem these should be greyed out to let you know.
That would be nice, but it's not so. /O1 and /O2 are just shortcuts anyway.

/O1 = /Og /Os /Oy /Ob2 /Gs /GF /Gy

/O2 = /Og /Oi /Ot /Oy /Ob2 /Gs /GF /Gy

If you also enabled any of those other options they're redundant but not
harmful.
Bigger question is what have people found in setting up the
optimizing? Using /O1 or /O2 ? Any ideas would be greatly appreciated.


The default for a release build is /O2. In the past (VC6) many people found
that /O1 actually generated faster code. I'd go with the default of /O2 but
if you're curious, do some profiling of your app under the workloads that
are important to you to see if /O1 or some other combination is a better
choice for you.

You may also want to try /GL and the related linker setting /LTCG which
enable cross-module inlining.

With VC++ 2005 you'll also get PGO - Profile guided optimization that allows
you to run an instrumented version of your application to gather profile
information which can then be fed back into the compiler to produced an even
more optimized version.

-cd
Nov 17 '05 #2
Thanks for your answer Daniel! A couple of other questions on this if someone
can answer. What would be the settings for .NET 2003 to match Visual C++ 6.00
optimizing? I find the executable from .NET 2003 alot larger then what was
produced under 6.00?

"Carl Daniel [VC++ MVP]" wrote:
Flashman wrote:
A little confusing with setting up optimizing options with 2003 .NET.
Under the Optimization Tab. if you set to /O1 or /O2 is the program
ignoring the settings for Inline Function expansion, Enabling of
Intrinsic?
Would seem these should be greyed out to let you know.


That would be nice, but it's not so. /O1 and /O2 are just shortcuts anyway.

/O1 = /Og /Os /Oy /Ob2 /Gs /GF /Gy

/O2 = /Og /Oi /Ot /Oy /Ob2 /Gs /GF /Gy

If you also enabled any of those other options they're redundant but not
harmful.
Bigger question is what have people found in setting up the
optimizing? Using /O1 or /O2 ? Any ideas would be greatly appreciated.


The default for a release build is /O2. In the past (VC6) many people found
that /O1 actually generated faster code. I'd go with the default of /O2 but
if you're curious, do some profiling of your app under the workloads that
are important to you to see if /O1 or some other combination is a better
choice for you.

You may also want to try /GL and the related linker setting /LTCG which
enable cross-module inlining.

With VC++ 2005 you'll also get PGO - Profile guided optimization that allows
you to run an instrumented version of your application to gather profile
information which can then be fed back into the compiler to produced an even
more optimized version.

-cd

Nov 17 '05 #3
Flashman wrote:
Thanks for your answer Daniel! A couple of other questions on this if
someone can answer. What would be the settings for .NET 2003 to match
Visual C++ 6.00 optimizing? I find the executable from .NET 2003 alot
larger then what was produced under 6.00?


The settings are basically equivalent between the two, but there's no
combination of settings that will cause VC7.1 to produce exactly the same
code as VC6.

Some ideas in regard to executable size:

1. Make sure you're looking at a release build, not a debug build. VC7+
debug builds are quite a lot larger due to additional debug code.
2. Make sure you're not compiling with /RTC or /GS. Those options increase
code size, and VC6 had no equivalent options.
3. Use a linker map to determine the actual code size of the modules YOU
wrote. Many library modules are larger in VC7+ due to additional robustness
features, conformance improvements, etc.
4. Use dumpbin to determine the size of the code in your executable instead
of the size of the executable itself. There may be additional initialize
data (etc) in the VC7+ executable.
5. Make sure you're comparing native builds - i.e. that you're not compiling
with /clr in VC7.1. Otherwise you're comparing two different machine
architectures.

When you account for the other things that affect executable size, you'll
generally find that VC7.1 produces smaller/faster code than VC6.

-cd

Nov 17 '05 #4
Hello Daniel:

Problem that occurs is that I have an application under Visual C++ 6.0 exe
release size around 9.7MBytes. Compiling under .NET 2003 release with some
optimizing on produces code ~11 MBytes. Turn on some optimizing (Specifically
Global Opt)
and the program crashes.

Thanks again, will try to profile the app.
Cheers,
Randy

"Carl Daniel [VC++ MVP]" wrote:
Flashman wrote:
Thanks for your answer Daniel! A couple of other questions on this if
someone can answer. What would be the settings for .NET 2003 to match
Visual C++ 6.00 optimizing? I find the executable from .NET 2003 alot
larger then what was produced under 6.00?


The settings are basically equivalent between the two, but there's no
combination of settings that will cause VC7.1 to produce exactly the same
code as VC6.

Some ideas in regard to executable size:

1. Make sure you're looking at a release build, not a debug build. VC7+
debug builds are quite a lot larger due to additional debug code.
2. Make sure you're not compiling with /RTC or /GS. Those options increase
code size, and VC6 had no equivalent options.
3. Use a linker map to determine the actual code size of the modules YOU
wrote. Many library modules are larger in VC7+ due to additional robustness
features, conformance improvements, etc.
4. Use dumpbin to determine the size of the code in your executable instead
of the size of the executable itself. There may be additional initialize
data (etc) in the VC7+ executable.
5. Make sure you're comparing native builds - i.e. that you're not compiling
with /clr in VC7.1. Otherwise you're comparing two different machine
architectures.

When you account for the other things that affect executable size, you'll
generally find that VC7.1 produces smaller/faster code than VC6.

-cd

Nov 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: A Future Computer Scientist | last post by:
A question: Is it really important to think about optimizing the native code or optimizing it for P Code? Or does the code you write make a difference?
0
by: sameer | last post by:
Hi All, We had developed a .Net application which has the following environment Uses the No touch deployment concept Uses framework 1.1 on client and server machine, Visual studio 2003, Sql...
2
by: sameer | last post by:
Hi All, We had developed a .Net application which has the following environment Uses the No touch deployment concept Uses framework 1.1 on client and server machine, Visual studio 2003, Sql...
32
by: Bob | last post by:
Can anyone point me to a place where I can obtain the Microsoft C/C++ Optimizing Compiler Version 7.00. It was distributed about 10 years ago on floppy diskettes. I had a valid license but...
0
by: sameer | last post by:
Hi All, We had developed a .Net application which has the following environment Uses the No touch deployment concept Uses framework 1.1 on client and server machine, Visual studio 2003, Sql...
6
by: Uros | last post by:
Hello! I have some trouble getting good results from my query. here is structure stat_views id | integer id_zone | integer created | timestamp
2
by: Brian | last post by:
In particular, this question goes out to the Microsoft C++ development team. Back in June, Ronald Laeremans posted the following message. Has the optimizing compiler been included with the...
1
by: Greg | last post by:
A release configuration in the standard edition of C++ .NET 2003 says "Maximize Speed (/02)". Does anyone know how that compares with the optimizing capabilities of the Profesional edition?
7
by: sameer | last post by:
Hi all, Application environment : VB.Net desktop application,.NET 1.1 Framework, VS 2003. communicates between the database and the application is done over webservices using ADO.NEt Datasets....
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
1
by: Johno34 | last post by:
I have this click event on my form. It speaks to a Datasheet Subform Private Sub Command260_Click() Dim r As DAO.Recordset Set r = Form_frmABCD.Form.RecordsetClone r.MoveFirst Do If...
1
by: ezappsrUS | last post by:
Hi, I wonder if someone knows where I am going wrong below. I have a continuous form and two labels where only one would be visible depending on the checkbox being checked or not. Below is the...
0
by: jack2019x | last post by:
hello, Is there code or static lib for hook swapchain present? I wanna hook dxgi swapchain present for dx11 and dx9.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.