473,706 Members | 2,337 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 2222
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/highperfmanaged apps.asp?frame= true

For more information about ngen, check out:

http://msdn.microsoft.com/library/de...us/cptools/htm
l/cpgrfnativeimag egeneratorngene xe.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**********@h otmail.com>
Sender: "MR" <mo**********@h otmail.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: AcODoETjwP8TKDA kSeSwsDLfpu2aaw ==
Newsgroups: microsoft.publi c.dotnet.langua ges.vb
Path: cpmsftngxa06.ph x.gbl
Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.langua ges.vb:141310
NNTP-Posting-Host: TK2MSFTNGXA09 10.40.1.161
X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.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
instantiatio n. 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
4709
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 update esan set tes_address_city = 'TEST123' --at some time backup database TESTWMS to disk = 'D:\temp\RecoveryTest\TESTWMS.db' backup log TESTWMS to disk = 'D:\temp\RecoveryTest\TESTWMS01.log'
8
5258
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 developing a web-based application, one part of which involves allowing the user the ability to page through transaction "history" information. The _summary_ history table will have the following fields: ServiceName, Date, User-Ref1, User-Ref2,...
4
1526
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. Configuration Error Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately. Parser Error...
7
2448
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 firing. I have double-checked everything (and rechecked) and I haven't found anything that would explain why the Application is not starting. Here is what I have done so far to troubleshoot this: In IIS Manager I have ensured that there is a...
8
1704
by: Chris | last post by:
Hi, All my websites and webservices are down. I get the following message Server Error in '/mywebservices' Application. -------------------------------------------------------------------------------- Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
3
1403
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 microsoft windows platform spoils the other microsoft windows platform. For example: I have two projects, one for pc and one for pocket pc. I would like (or better I have to) share the
17
2282
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 scripts. each when clicked i am able to run the script. so HOW and what do i do to call and run the .sql Thanks
0
1134
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 ones are ok so somewhere the reference gets lost. We have also observed if we remove the asp.net cache files manually and restart the IIS the problem goes away. We are using ASP.NET 2.0 and did not see this issue in the 1.0 version. Can anybody...
0
952
by: tanske | last post by:
Hi, Here's the error I received after browsing the ASMX file from IIS. Server Error in '/ABC' Application. -------------------------------------------------------------------------------- Configuration Error
0
8781
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
8696
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
9155
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...
1
9050
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,...
1
6614
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...
0
4709
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3147
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
2500
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2094
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.