473,507 Members | 2,473 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

URGENT: Please Help: .Net dll compilation time

MR
Hi,
it has been observed that when we try to instantiate
a .Net dll for the first time in a session (e.g. from an
exe in .Net), it takes almost 10 times compared to
subsequent instantiations.

We have A.exe, developed in VB.Net, where, in a button
click, we are instantiating the Test.dll also developed in
VB.Net. We run three instances of A.exe simultaneously
(say A1, A2 and A3 are the three instances). Clicking on
the button in A1, A2 and A3 for the first time, it takes
almost 2000 miliseconds to instantiate the dll in each
instance (A1, A2, A3). Clicking the second time onwards,
the time for instantiation reduces to 130 miliseconds.

My questions are:
1. As I understand a dll can take more time in the first
instantiation. But why is it taking more time in the first
click from each of the exe instances instead of just the
very first click from A1? Why is it session/connection
dependent?

2. Is there any way we can ensure that the dll
instantiates in the fastest possible time in the very
first try?

It would great if someone can please help.

Thanks,
M.R.

Nov 20 '05 #1
1 2214
Hi MR,

.Net is a Just in time compiled platform so the first click on a button it
takes time to compile all the methods that are being called by that click
but each subsequent click is fast because .Net doesn't need to compile that
code again. The reason you are seeing this per-instance rather than system
wide is that the a .Net assembly (dll or exe) is loaded in to each process
independently. Each process creates what is called an AppDomain (a process
contains at least one default domain but can contain more) that contains
the assemblies loaded for that program.

As far as beating this performance hit, we have a utility that ships with
the .Net framework called ngen.exe. ngen performs the Just in Time compile
step in advance and saves the native code image created to a system cache
where it can be used for speedier execution. If you run the ngen utility on
your assemblies then run them, you should see an increase in performance.
In fact, this is one of Microsoft's recomended performance enhancements.

For more information about writing performant managed code, check out:

http://msdn.microsoft.com/library/de...us/dndotnet/ht
ml/highperfmanagedapps.asp?frame=true

For more information about ngen, check out:

http://msdn.microsoft.com/library/de...us/cptools/htm
l/cpgrfnativeimagegeneratorngenexe.asp

--
Michal Sampson VB .Net Deployment Developer
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

Note: For the benefit of the community-at-large, all responses to this
message are best directed to the newsgroup/thread from which they
originated.
--------------------
Content-Class: urn:content-classes:message
From: "MR" <mo**********@hotmail.com>
Sender: "MR" <mo**********@hotmail.com>
Subject: URGENT: Please Help: .Net dll compilation time
Date: Thu, 25 Sep 2003 13:04:47 -0700
Lines: 31
Message-ID: <0b****************************@phx.gbl>
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
X-MIMEOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
Thread-Index: AcODoETjwP8TKDAkSeSwsDLfpu2aaw==
Newsgroups: microsoft.public.dotnet.languages.vb
Path: cpmsftngxa06.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.vb:141310
NNTP-Posting-Host: TK2MSFTNGXA09 10.40.1.161
X-Tomcat-NG: microsoft.public.dotnet.languages.vb

Hi,
it has been observed that when we try to instantiate
a .Net dll for the first time in a session (e.g. from an
exe in .Net), it takes almost 10 times compared to
subsequent instantiations.

We have A.exe, developed in VB.Net, where, in a button
click, we are instantiating the Test.dll also developed in
VB.Net. We run three instances of A.exe simultaneously
(say A1, A2 and A3 are the three instances). Clicking on
the button in A1, A2 and A3 for the first time, it takes
almost 2000 miliseconds to instantiate the dll in each
instance (A1, A2, A3). Clicking the second time onwards,
the time for instantiation reduces to 130 miliseconds.

My questions are:
1. As I understand a dll can take more time in the first
instantiation. But why is it taking more time in the first
click from each of the exe instances instead of just the
very first click from A1? Why is it session/connection
dependent?

2. Is there any way we can ensure that the dll
instantiates in the fastest possible time in the very
first try?

It would great if someone can please help.

Thanks,
M.R.


Nov 20 '05 #2

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

Similar topics

6
4700
by: Rajesh Garg | last post by:
I have actually extended my request I have a scenario like this....... update esan set tes_address_city = 'TEST1' --at some time update esan set tes_address_city = 'TEST12' --at some time...
8
5208
by: Mike | last post by:
Hello, I have a few rather urgent questions that I hope someone can help with (I need to figure this out prior to a meeting tomorrow.) First, a bit of background: The company I work for is...
4
1521
by: Jie | last post by:
Hi, I am using Visual Studio .Net 2003 in XP environment. It keeps coming up the following error. So I have to restart the PC every time it comes. Please advise what is wrong with this. Thanks. ...
7
2429
by: Gordon Smith | last post by:
I have four (4) ASP.NET Web applications/Web sites on a IIS/6 - Windows Server 2003 production server. 3 of them work fine. I just installed the 4th one and it's Application_Start event is not...
8
1693
by: Chris | last post by:
Hi, All my websites and webservices are down. I get the following message Server Error in '/mywebservices' Application....
3
1392
by: chris | last post by:
Hallo, I am in need of a replacement for the Microsoft Visual Studio .NET. The reason is quiet simple. I develop forms which are used on different microsoft windows platform, and one...
17
2265
by: Saps | last post by:
Hi all. Can anyone help me here. I have loads of .sql files and i need a way to call these from my asp page so the user can run them from the browser. Meaning i have a page with a list of all...
0
1125
by: Vish | last post by:
Hi, We are having issues whenever we push the dynamically compiled .ascx files into prod. These are the files with no codebehind and what happens is that the old users see this error and the new...
0
947
by: tanske | last post by:
Hi, Here's the error I received after browsing the ASMX file from IIS. Server Error in '/ABC' Application. --------------------------------------------------------------------------------...
0
7221
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,...
0
7313
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,...
1
7029
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
7481
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...
0
5619
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,...
0
3190
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...
0
1537
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 ...
1
758
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
411
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...

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.