This is a discussion on What is Ngen.exe in DotNet? within the VB.NET Programming forums, part of the Software Development category; What is Ngen.exe in DotNet? What its use ?...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
|
#1
| |||
| |||
| What is Ngen.exe in DotNet? What its use ? |
|
#2
| |||
| |||
| The Native Image Generator utility (Ngen.exe) allows you to run the JIT compiler on your assembly's MSIL and generate native machine code which is cached to disk. After the image is created .NET runtime will use the image to run the code rather than from the hard disk. Running Ngen.exe on an assembly potentially allows the assembly to load and execute faster, because it restores code and data structures from the native image cache rather than generating them dynamically. |
|
#3
| |||
| |||
| Native images load faster than MSIL because JIT compilation and type-safety verification is eliminated.
__________________ S.VinothkumaR Behind me is infinite power, Before me is Endless Possibility, Around me is Boundless Opportunity, Why should I fear! |
|
#4
| |||
| |||
| If you are sharing code between process Ngen.exe improves the performance significantly. As Native image generated Windows PE file so a single DLL file can be shared across applications. By contrast JIT produced code are private to an assembly and can not be shared.
__________________ S.VinothkumaR Behind me is infinite power, Before me is Endless Possibility, Around me is Boundless Opportunity, Why should I fear! |
|
#5
| |||
| |||
| - Native images enable code sharing between processes. - Native images require more storage space and more time to generate.
__________________ S.VinothkumaR Behind me is infinite power, Before me is Endless Possibility, Around me is Boundless Opportunity, Why should I fear! |
|
#6
| |||
| |||
| Startup time performance improves lot. We can get considerable gains when applications share component assemblies because after the first application has been started the shared components are already loaded for subsequent applications. If assemblies in an application must be loaded from the hard disk, does not benefit as much from native images because the hard disk access time shadows everything.
__________________ S.VinothkumaR Behind me is infinite power, Before me is Endless Possibility, Around me is Boundless Opportunity, Why should I fear! |
|
#7
| |||
| |||
| Assemblies in GAC do not benefit from Native image generator as the loader performs extra validation on the strong named assemblies thus shadowing the benefits of Native Image Generator.
__________________ S.VinothkumaR Behind me is infinite power, Before me is Endless Possibility, Around me is Boundless Opportunity, Why should I fear! |
|
#8
| |||
| |||
| If any of the assemblies change then Native image should also be updated. You should have administrative privilege for running Ngen.exe.
__________________ S.VinothkumaR Behind me is infinite power, Before me is Endless Possibility, Around me is Boundless Opportunity, Why should I fear! |
|
#9
| |||
| |||
| While this can fasten your application startup times as the code is statically compiled but it can be somewhat slower than the code generated dynamically by the JIT compiler. So you need to compare how the whole application performance with Ngen.exe and with out it.
__________________ S.VinothkumaR Behind me is infinite power, Before me is Endless Possibility, Around me is Boundless Opportunity, Why should I fear! |
|
#10
| |||
| |||
| Thank you vinoth... You have posted lot of information about Ngen.exe... But how to run that? |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| DotNet Remoting _ Interview Questions and Answers | S.Vinothkumar | Interview Questions & Answers and Tips | 9 | 04-18-2008 09:14 AM |
| OOPs Tips for DotNet. | S.Vinothkumar | Interview Questions & Answers and Tips | 11 | 10-29-2007 06:20 AM |
| Transaction Scope in DotNet using C#. | S.Vinothkumar | C# Programming | 52 | 09-22-2007 12:15 AM |
| WebServices in DotNet | S.Vinothkumar | ASP and ASP.NET Programming | 47 | 09-11-2007 07:41 AM |
| What is Native Image Generator (Ngen.exe) in asp.net? | oxygen | ASP and ASP.NET Programming | 1 | 07-26-2007 03:06 AM |
Our Partners |