Groups | Blog | Home
all groups > dotnet performance > january 2004 >

dotnet performance : Ngen'ing assemblies during install



Stephen
1/23/2004 4:30:27 PM
We're looking at improving the performance of our application by ngen'ing
our assemblies. As I understand ngen must be run post install as it is
specific to each pc's configuration.

I've created a batch file to do most of these steps, all I need to do is
find some way of getting the location of ngen (the location of the .net
framework + version directory). Is there a registry key or some other easy
way of finding the location of the ngen executable?

Mattias Sjögren
1/23/2004 9:43:33 PM
Stephen,

[quoted text, click to view]

Do you have to use a batch file? Have you seen this?

Walkthrough: Using a Custom Action to Pre-Compile an Assembly During
Installation
http://msdn.microsoft.com/library/en-us/vsintro7/html/vxwlkwalkthroughusingcustomactiontoprecompileassermblyduringinstallation.asp



Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Stephen
1/26/2004 9:14:17 AM
Thanks for the reply!

We did investigate using the deployment solutions provided by visual studio,
but found their capability very limited and their use restrictive. We've got
our own installation software (ZeroG InstallAnywhere) and I was thinking of
adding a post install step of running my batch file to ngen the assemblies.
The only problem is I can't find an easy way of locating the current .net
framework directory containing ngen.exe. Can anyone help?

Stephen
1/26/2004 9:24:33 AM
We've also had a look at ngen'ing some of the System assemblies, as it looks
as though only a few are ngen'd during the install of the framework. Is this
recommended? The reason i ask is i am wondering why they are not all ngen'd
during the install of the framework.

Also, if I do ngen the system assemblies, should I delete these native
images during the uninstall? Only there doesn't seem to be any way of
telling how many people have ngen'd each assembly and so I wouldn't want to
remove this image if some other application also wanted it ngen'd.

Conrad Zhang
1/27/2004 8:46:27 PM
mscoree!GetCORSystemDirectory.

[quoted text, click to view]

Conrad Zhang
1/29/2004 12:05:42 AM
Ngen is not a good story in v1/v1.1. It is probably not worth that much to
ngen your assemblies.
It is a totally different story in whidbey though.

You have to remove those native images yourself. Native images are not ref
counted. As long as you don't touch the system assemblies, you should be
fine removing other native images.

[quoted text, click to view]

Petri J. Riipinen
3/17/2004 1:44:13 PM
[quoted text, click to view]

Could you elaborate on this? What makes it worth considering with Whidbey?

- Petri

Matt Davey
3/17/2004 4:41:38 PM
NGen files can get out of sync, plus exceution performance is worse than
non-NGen apps. In Whidbey, Microsoft has a number of improvement coming
that improve NGen applications. Try checking the PDC slides, if I remember
correctly there was a presentation on NGen.

http://www.developer.com/net/cplus/article.php/1366921
http://blog.bretherton.net/archive/2003/10/26/209.aspx

Later
http://weblogs.asp.net/mdavey/

"Petri J. Riipinen" <petri.riipinen@removethispart.koti.soon.fi.invalid>
[quoted text, click to view]

AddThis Social Bookmark Button