?
Solved

NGEN.exe, how to use it and can it be used in an MSI??

Posted on 2005-03-11
7
Medium Priority
?
625 Views
Last Modified: 2011-04-14
I have been reading how the ngen.exe may help the launch time of an application, but I was hoping someone could shed more light on how to use it.

Here is my scenerio.

My application has extremely slow launch time and I am assuming its because its compiling very large shared assemblies that are from MapInfo.  There are 6 assemblies in total that it uses and the start up time is in excess of two minutes.

Will NGEN.exe benefit me?
Do I only have to apply it the main executable?
If not can I apply it to Mapinfo assemblies?

And if I could do any of these, can it be used in a installation Package ?

Thanks for the help!
0
Comment
Question by:leonardjp
  • 4
  • 3
7 Comments
 
LVL 25

Accepted Solution

by:
RonaldBiemans earned 2000 total points
ID: 13517847
My guess is,it will benefit you since you use shared assemblies, you could apply it to the main executable or to the individual assemblies. And yes you can do it in your setup (you must add ngen  to your installation package though).

If you use a lot off dlls in your program you might also want to consider changing the base addresses of these dlls,
(Windows can load DLLs much faster if they don't have to be rebased) this is especially true if the dll has been precompiled with the Ngen Utility

use like

ngen mainapp.exe Assembly1.dll Assembly2.dll assembly3.dll

when this syntax is used, ngen compiles all the dlls and optimizes them for executing in the main application's context, taking the applications configuration file into account.
0
 
LVL 25

Expert Comment

by:RonaldBiemans
ID: 13517884
To change the base address of your dll, use the properties of your project, choose configuration properties, choose optimizations. try keeping the values far enough apart so that dll don't overlap in memory
0
 
LVL 25

Expert Comment

by:RonaldBiemans
ID: 13517902
But keep in mind that it will load faster, but it will probably run slower.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:leonardjp
ID: 13522314
Could you explain, in a little more detail, how to add ngen to the installation package?
0
 

Author Comment

by:leonardjp
ID: 13524764
Also, I am creating the MSI using MapInfo Merge Modules, will NGEN be any help to me?
0
 
LVL 25

Expert Comment

by:RonaldBiemans
ID: 13532845
To add ngen to your installation package just add it in the file system of your installation package, and run it in a custom action in the commit phase. I'm afraid I have no experience with mapinfo merge modules so I'm no help there :-)
0
 

Author Comment

by:leonardjp
ID: 13537261
Thanks for the help.  I have changed the base address of my dlls and that has appeared to work a little.   I'll attempt the NGEN and compare the performance.  thanks again.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
Kernel Data Recovery is a renowned Data Recovery solution provider which offers wide range of softwares for both enterprise and home users with its cost-effective solutions. Let's have a quick overview of the journey and data recovery tools range he…
Planning to migrate your EDB file(s) to a new or an existing Outlook PST file? This video will guide you how to convert EDB file(s) to PST. Besides this, it also describes, how one can easily search any item(s) from multiple folders or mailboxes…
Suggested Courses
Course of the Month7 days, 19 hours left to enroll

615 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question