473,762 Members | 7,330 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 2735
"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
2208
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
2416
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
1482
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
1132
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
840
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
9378
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,...
0
10137
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9989
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9812
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
8814
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7360
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
3914
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
3
3510
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2788
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.