Welcome to MSDN Blogs Sign in | Join | Help

VC++ Blog Tour Stop: Content Part 3: Making Your Application Better

Optimizations

There are primarily two major optimization features in the 2005 release, whole program optimization and profile guided optimization, and also new specialized support for newer processors (/G7 for Pentium 4 processors) along with significantly improved mixed targeting and improved speed optimization and better precision of floating point operations.  Because of the basic improvements in the compiler, you will see an average performance improvement in the range of 10-30%, depending on which version you are upgrading from.

Whole Program Optimization (/GL) has actually been available since 2002, but was significantly improved for 2005.  By getting the compiler and linker to work together, we are able to begin optimizing programs by analyzing separate object files.  While your link times may increase when using this feature, this too will yield an average improvement of around 30% when upgrading from 2002.  This feature is widely used within Microsoft.

Profile Guided Optimization is new for 2005, and allows you to optimize your product for expected user scenarios.  With PGO (we call it "po-go"), you instrument your project during a build, run your scenarios, and after one more rebuild, you have built your applications or components to be optimized for the user scenarios.  Additionally, you can choose to just update your PGO build, so that you can build and rebuild only the parts of your project that have actually changed.  PGO offers and additional 5-10% improvement over whole program optimization alone.  This is use on large code bases at Microsoft, including Windows and SQL.

For more information about optimizations, check out these links:

C++ Rules: Power Your App with the Programming Model and Compiler Optimizations of Visual C++

Profile-Guided Optimizations with Microsoft Visual C++ 2005

Video: Using High Performance Features in Visual C++

 

Analyzing Your Application Source

You have probably heard by now of the many tools that will be available in the Visual Studio Team System products.  With Visual Studio products targeting specific job roles - architect, developer and test, there are many new tools that will help you analyze and test your code.  Some examples of the tools you will find in these product releases include static code analysis (PreFast), a profiler, and unit testing.  Find out more here.


Improving Your Application Reliability

As I mentioned before, the 2003 release brought the VC++ compiler a long way in conformance.  This helps enable you to use advanced code techniques and also to make code portable.  The latest libraries also bring you reliability and safer functionality by using runtime check of parameters for values inside a value range and adding a new set of functions with safer signatures.  We want to make sure that the libraries are service-able, so we have a new redistribution model.

Until the release of 7.0/2002, VC runtime redistributables were simply installed to the System or System32 folder.  For 2002 and 2003, the recommendation was to install to your applications local directory instead, to start eliminating the problem of DLL hell.  This didn't prove to be completely effective and also posed a huge servicing problem, which is very important as security becomes increasingly more important.  You may recall the tact we had to use in servicing gdiplus.dll, where we had to ask all users to run a tool in order to detect all of the locations of the file that needed to be patched.  Of course, as soon as you ran another old setup with an unsafe copy, you would have to go through the detect-and-fix process again.

In the 2005 release we now fully support the Windows Side by Side redistribution model (fusion) where a real versioning and servicing story comes to fruition.  Additionally, we provide the tools to allow you to also distribute your components in this way, providing the same versioning and servicing support and also complying with Windows logo requirements.

Learn more from these sources:

Build More Secure Applications

Nikola Dudar's Blog

Deployment Documentation

 

Next Stop: More about securing your application

Published Friday, September 16, 2005 1:58 AM by AprilR
Filed under: ,

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

Thursday, September 29, 2005 9:15 AM by Hermann Schinagl

# re: VC++ Blog Tour Stop: Content Part 3: Making Your Application Better

/G7 And how do I use this from the VS2005 GUI? I was not able to find it. Only a command line switch?
ciao hermann

Leave a Comment

(required) 
required 
(required) 

  
Enter Code Here: Required
 
Page view tracker