473,416 Members | 1,762 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,416 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 1454
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.