473,770 Members | 7,142 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2736
"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******** ******@TK2MSFTN GP10.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******** ******@TK2MSFTN GP10.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
1988
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 application in question is quite a complex one and I doubt this will be a simple task. Thereafter it is likely that the publishers of the application will want to
1
1734
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 it a.dll) which I can run NGEN on, giving me the native image, (let's call it a_native.dll.) * Using the same version of NGEN and the same a.dll, I create a_native.dll on both of these dev boxes. * I do a binary diff on the 2 a_native.dll files...
2
430
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 assemblies because from what I know that might just as well slow things down as speed them up. Could someone out there run ngen /show for me and post a list of the standard precompiled assemblies so I know which ones to re-precompile? NGen is typically in...
2
2209
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
2417
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 produces cannot be shared between App Domains" I'm afraid I'm not sure what an App Domain is in this context, but we don't have a web farm/web garden. It's a single web site running on IIS 6. We do not use the GAC for any of our assemblies.
3
313
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 both methods precompiled, I believe I can do ngen A.dll B.dll
7
1483
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 read the conversation between Steven Cheng and MLibby on this group (search for "ngen" to find it) - I'm thinking my plan is scuppered. Then again, that's 2004.
0
1133
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 requirement. The idea is some of the modules in the application are quite large and users could be working on multiple modules during a single application session. We would like to unload the modules they are finished. Each module will be loaded in a...
0
842
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 the IL assemblies. However it seems that NGen is run on a per machine basis, so I would still have to run it after copying it across. is it possible to copy NGen'd assemblies between machines so you don't need to NGen again? cheers
0
9592
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9425
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10004
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9870
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5313
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5450
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3972
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3576
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2817
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.