473,396 Members | 2,030 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

NGEN and resolving assemblies

Wol
I have two assemblies, A.dll and B.dll.

A.dll contains two methods. One method, UsesB, uses a type from B.dll
whereas the other, DoesNotUseB, does not.

To cache a native image of A.dll with both methods precompiled, I believe I
can do

ngen A.dll B.dll

I think I could also do

ngen B.dll
ngen A.dll

Will just

ngen A.dll

also produce a native image of A.dll with both methods precompiled, or will
it precompile only the method that does *not* use types from B.dll? (or will
it precompile neither?)

In other words, does

ngen A.dll

resolve B.dll and use the metadata in B.dll to work out the physical layout
of the types in B.dll so that it can generate native code for A.UsesB(), or
does it need B.dll to be in the native image cache already, or do I actually
have to supply both dlls to ngen at the same time, ie

ngen A.dll B.dll

TIA
Jul 19 '05 #1
2 2715
"ngen A.dll" is not the same as "ngen A.dll B.dll". The latter will
pre-compile both assemblies.

"ngen A.dll" will load B automatically (through the normal assembly probing
logic), and compile both methods.

To prove it, run "ntsd ngen A.dll", you will see b.dll in the loaded module
list, assuming b.dll can be found by ngen.
"Wol" <mr***@hotmail.com> wrote in message
news:O8**************@TK2MSFTNGP10.phx.gbl...
I have two assemblies, A.dll and B.dll.

A.dll contains two methods. One method, UsesB, uses a type from B.dll
whereas the other, DoesNotUseB, does not.

To cache a native image of A.dll with both methods precompiled, I believe I can do

ngen A.dll B.dll

I think I could also do

ngen B.dll
ngen A.dll

Will just

ngen A.dll

also produce a native image of A.dll with both methods precompiled, or will it precompile only the method that does *not* use types from B.dll? (or will it precompile neither?)

In other words, does

ngen A.dll

resolve B.dll and use the metadata in B.dll to work out the physical layout of the types in B.dll so that it can generate native code for A.UsesB(), or does it need B.dll to be in the native image cache already, or do I actually have to supply both dlls to ngen at the same time, ie

ngen A.dll B.dll

TIA

Jul 19 '05 #2
The ngen image of A will use indirections (similar to IATs in the unmanaged
world) to access data from B.dll. (In the next version, these indirections
can be removed).

We will resolve the physical layout of types in B. So if B.dll changes, you
need to re-ngen A.dll as the old ngen image is/may be invalid and will not
be used anymore.

"Wol" <mr***@hotmail.com> wrote in message
news:O8**************@TK2MSFTNGP10.phx.gbl...
I have two assemblies, A.dll and B.dll.

A.dll contains two methods. One method, UsesB, uses a type from B.dll
whereas the other, DoesNotUseB, does not.

To cache a native image of A.dll with both methods precompiled, I believe I can do

ngen A.dll B.dll

I think I could also do

ngen B.dll
ngen A.dll

Will just

ngen A.dll

also produce a native image of A.dll with both methods precompiled, or will it precompile only the method that does *not* use types from B.dll? (or will it precompile neither?)

In other words, does

ngen A.dll

resolve B.dll and use the metadata in B.dll to work out the physical layout of the types in B.dll so that it can generate native code for A.UsesB(), or does it need B.dll to be in the native image cache already, or do I actually have to supply both dlls to ngen at the same time, ie

ngen A.dll B.dll

TIA

Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Doug Holland | last post by:
Hi There If you have a .NET based application installed and you'd like to increase the start-up performance of that application; can you NGen assemblies once the application is installed? The...
1
by: Will | last post by:
Hi All, * I have 2 dev machines, one is running WinXP Pro and one is running Win2K Server. Each has Visual Studio .NET 7.0 installed (the .NET 1.0 dev tools.) * I have a .NET .dll (let's call...
2
by: Laurence | last post by:
So I had an 1D10T moment today: ran ngen /delete * and then compounded my error by closing the window. Of course now my window code starts far slower, but I don't want to blindly precompile...
2
by: JMMB | last post by:
Just a confirmation. NGen generates native code when i install the windows application on the client or when I run it for the first time? thanks,
1
by: Mark | last post by:
I was hoping to use nGen to speed up the time taken for our web site to start running. However, on the web we found this quote: "NGen is not recommend for Asp.Net because the assemblies NGen...
3
by: Wol | last post by:
I have two assemblies, A.dll and B.dll. A.dll contains two methods. One method, UsesB, uses a type from B.dll whereas the other, DoesNotUseB, does not. To cache a native image of A.dll with...
7
by: musosdev | last post by:
Hi guys I've just read the article in this months MSDN about using Ngen to speed up initial load times and I thought "great, I can speed up initial load of my web app!". However, having just...
0
by: Vince | last post by:
My current project (a desktop application that’s currently developed on .net v1.1) call for 1) Use ngen.exe to improve the startup speed. 2) Use multiple AppDomain to reduce the memory...
0
by: mcintyre321 | last post by:
Hi all, I am looking into NGen.exe to solve a problem. At my firm, when we upload new code to the live servers they take an age to start up. I've heard that NGen can speed this time by be JITing...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.