Questions tagged [ngen]

The Native Image Generator (Ngen.exe) is a tool for the .NET framework that improves the performance of managed applications by creating and caching processor-specific machine code, so that just-in-time compilation is no longer necessary.

From Native Image Generator (Ngen.exe) on MSDN:

The Native Image Generator (Ngen.exe) is a tool that improves the performance of managed applications. Ngen.exe creates native images, which are files containing compiled processor-specific machine code, and installs them into the native image cache on the local computer. The runtime can use native images from the cache instead using the just-in-time (JIT) compiler to compile the original assembly.

158 questions
140
votes
1 answer

TargetedPatchingOptOut: "Performance critical to inline across NGen image boundaries"?

Been going through some framework classes using reflector and noticed a number of the methods and properties have the following attribute [TargetedPatchingOptOut("Performance critical to inline across NGen image boundaries")] I'm pretty sure I…
Maxim Gershkovich
  • 42,124
  • 39
  • 134
  • 227
47
votes
8 answers

Have you ever used ngen.exe?

Has anybody here ever used ngen? Where? why? Was there any performance improvement? when and where does it make sense to use it?
Hannoun Yassir
  • 18,630
  • 22
  • 74
  • 109
31
votes
5 answers

JIT vs NGen - what is the difference?

So when CLR runtime load a .NET assembly, it compiles it into machine native code. This process is called JITing. NGen is also the process of compiling .NET assembly into native code. I don't understand what is the difference between two?
palm snow
  • 2,314
  • 4
  • 27
  • 47
31
votes
2 answers

What is the difference between .NET Native and Ngen.exe?

The title says it all. I was hoping somebody could explain to me what .NET Native brings to the table that we didn't already have with Ngen.exe.
Levi Botelho
  • 22,763
  • 5
  • 51
  • 94
25
votes
1 answer

MethodImplOptions.AggressiveInlining vs TargetedPatchingOptOut

What is the difference between the MethodImplAttribute with the option MethodImplOptions.AggressiveInlining and the TargetedPatchingOptOut? When I searched on Google everybody seems to says that both (might) inline the method but without giving the…
Yann Lebel
  • 625
  • 1
  • 7
  • 16
23
votes
5 answers

Where can I find location of generated file after doing Ngen?

I did Ngen on a C# executable. It was succesful, but I cannot figure out where the generated file is in my PC. MSDN says it should be in native image cache, still not able to figure out where it is.. EDIT : I want to run objdump on it, hence I need…
paseena
  • 3,889
  • 6
  • 29
  • 50
22
votes
1 answer

What is the format of `*.ni.dll.aux` files?

What is the format (data layout) of *.ni.dll.aux files found in C:\Windows\assembly\NativeImages_v4.0.30319_64? I understand that these are auxiliary files generated by ngen.exe. What data do they contain?
Marty Colos
  • 322
  • 1
  • 6
21
votes
2 answers

Is it possible to use NGen with ClickOnce deployment?

Is it possible to use NGen with ClickOnce deployment?
Branko
  • 525
  • 6
  • 15
21
votes
4 answers

How and when does ngen.exe work?

I want to know the benefit of pre-JIT compilation (ngen.exe). What is the role of the Native Image Generator (NGen) process and why is it required? Please provide an example.
Dhiren
  • 398
  • 1
  • 2
  • 10
18
votes
6 answers

Does it help to use NGEN?

Is it better to use NGEN an ASP.NET application when we know it is not going to change much? Or is the JIT good enough? The only reason I asked was because this article by Jeffrey Richter in 2002 says : And, of course, Microsoft is working quite…
Chakravarthy R
18
votes
1 answer

Method inlining across native images of assemblies

As explained in another question, Ngen is usually only allowed to inline methods across assemblies if the method has the TargetedPatchingOptOutAttribute set. But is this also true for hard bound assemblies by using the DependencyAttribute with…
cremor
  • 6,187
  • 25
  • 65
18
votes
2 answers

Correct way of updating a RemoteAPP application with NGEN

We have a Windows2008R2 RemoteAPP .NET 4.5 application NGEN-ed on the RDS server, with approx. 300 concurrent users for the 3-host NLB cluster. The application is under active development and the RemoteAPP deployed assemblies need to be updated…
16
votes
1 answer

How to Compile with ngen.exe and How to run the native code that is generated?

I want to compile a C# program using ngen command line for a special purpose. So I create a console application in VS2010 and named it ngentest. A file by name ngentest.vshost.exe is created in vs2010\projects\ngentest\bin\debug. I used this file as…
Azad
  • 367
  • 1
  • 6
  • 21
15
votes
6 answers

How to kill mscorsvw.exe

mscorsvw.exe (a.NET optimization that precompiles assemblies) is taking up a substantial percentage of my CPU - 50-100%. This article (and many others) say that ngen.exe executequeueditems From the command line should kill it. For me, that…
Adam Rackis
  • 79,454
  • 49
  • 255
  • 377
15
votes
3 answers

How is .NET JIT compilation performance (including dynamic methods) affected by image debug options of C# compiler?

I am trying to optimize my application for for it to perform well right after it is started. At the moment, its distribution contains 304 binaries (including external dependencies) totaling 57 megabytes. It is a WPF application doing mostly database…
cynic
  • 5,005
  • 1
  • 22
  • 40
1
2 3
10 11