From: Peter Duniho on
Tony Johansson wrote:
>> Execution: using NGEN will either not improve the performance or
>> make the app run slower (due to less information being available
>> when generating the native code).
>>
>> Startup: using NGEN may result in faster startup.
>>
>> In general you should not use NGEN.
>>
>> Arne
>>
>
> I don't understand your mail what is it that you try to say about Execution
> /Startup.

He is describing "Startup" as a separate phase of operation from
"Execution". One might consider "Execution" to include "Startup", but
it seems obvious to me from the context that that's not how Arne is
describing it. Rather, he is considering the two as different phases of
operation for a given assembly.

And if you look at the operation of a program being "Startup" followed
by "Execution", then ngen.exe can improve the "Startup" portion because
the compilation that normally happens then has already been done. But
since your program is already compiled once you get to the "Execution"
phase, whether or not you use ngen.exe, ngen.exe can't improve the
performance there.

> What I have heard is that instead of letting the CLR in a way compile MSIL
> code into native during runtime
> you can do this by using ngen so the startup should be faster. This is what
> I have heard.

Of course you have. You just heard it from Arne!

Pete
From: Arne Vajhøj on
On 17-02-2010 19:45, Tony Johansson wrote:
> "Arne Vajh�j"<arne(a)vajhoej.dk> skrev i meddelandet
> news:4b7c8a28$0$280$14726298(a)news.sunsite.dk...
>> On 17-02-2010 12:29, Tony Johansson wrote:
>>> "Alberto Poblacion"<earthling-quitaestoparacontestar(a)poblacion.org>
>>> skrev i
>>> meddelandet news:OuZxfw%23rKHA.6140(a)TK2MSFTNGP05.phx.gbl...
>>>> "Tony Johansson"<johansson.andersson(a)telia.com> wrote in message
>>>> news:eywm%23o%23rKHA.3968(a)TK2MSFTNGP02.phx.gbl...
>>>>> I just wonder how can I see if ngen has been run on an assembly(dll or
>>>>> exe)
>>>>
>>>> You can run "ngen display [assembly name]". If the assembly is not
>>>> installed in the native images cache, ngen will respond with "Error: The
>>>> specified assembly is not installed."
>>>
>>> I just wonder if anyone have any experience how much in performance
>>> profit
>>> it might give when uses this ngen utility.
>>> I'm just curious to know.
>>
>> Execution: using NGEN will either not improve the performance or
>> make the app run slower (due to less information being available
>> when generating the native code).
>>
>> Startup: using NGEN may result in faster startup.
>>
>> In general you should not use NGEN.
>
> I don't understand your mail what is it that you try to say about Execution
> /Startup.

startup = the time to load the code and JIT if not NGEN'ed
execution = the time to run after the code id loaded and JIT'ed

> What I have heard is that instead of letting the CLR in a way compile MSIL
> code into native during runtime
> you can do this by using ngen so the startup should be faster. This is what
> I have heard.

It is true !

:-)

How much depend on the complexity of the assembly.

Arne