.NETGURU
Slow Execution ?
Messages   Related Types
This message was discovered on ASPFriends.com 'aspngcs' list.


Liz
Hi ...

I'm just getting started with some REALLY simple C# workouts ... "Hello
World" stuff ... compile is fine but the execution is SLOW ... I experienced
the same thing fooling around with Win VB.NET simple apps

I'm talking about .EXE console apps here ... when I do the same things in
ASP.NET exec is fast after the first page request/compile ...

any thoughts out there ? thanks ...

Reply to this message...
 
    
Glavich, Paul C
Sometimes, loading the CLR (Common Language Runtime) which holds all the
.Net framework and support libraries takes sometime to load. Especially if
the app is small, it still loads quite a bit which can seem very slow for a
small application.

* Paul Glavich
Professional Web Services
Email: Click here to reveal e-mail address
(Currently no fixed phone or street address)

-----Original Message-----
From: Liz [mailto:Click here to reveal e-mail address]
Sent: Thursday, 27 June 2002 1:23 PM
To: aspngcs
Subject: [aspngcs] Slow Execution ?

Hi ...

I'm just getting started with some REALLY simple C# workouts ... "Hello
World" stuff ... compile is fine but the execution is SLOW ... I experienced
the same thing fooling around with Win VB.NET simple apps

I'm talking about .EXE console apps here ... when I do the same things in
ASP.NET exec is fast after the first page request/compile ...

any thoughts out there ? thanks ...

| [aspngcs] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngcs.asp = JOIN/QUIT

Reply to this message...
 
    
Andy Smith
aSBrbm93IHRoaXMgc291bmRzIHNpbGx5LCBidXQgaWYgeW91IGFyZSBleHBlcmllbmNpbmcgc2xv
dyBzdGFydHVwIHRpbWVzIGZyb20gd2luZG93cy5mb3JtcyBhcHBzLi4uDQptYWtlIHN1cmUgeW91
IGhhdmUgYW4gdXNlciBhY2NvdW50IG5hbWVkICJBU1BORVQiDQogDQppIHJlYWxpemUgeW91ciBh
cmVuJ3QgdGFsa2luZyBhYm91dCB3ZWIgYXBwbGljYXRpb25zLi4uIGJ1dCBJJ3ZlIGhlYXJkIHJl
cG9ydHMgdGhhdCB0aGlzIGZpeGVzIHRoZSBzaXR1YXRpb24uDQogDQppZiB0aGlzIGlzIG5vdCB0
aGUgb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Reply to this message...
 
    
Ken Meads
I know for me, whenever I start a program up for the first time, I can hear
the hard drive a' whirlin' for a 3-5 seconds and then my hello world
appears. But, after that, all is well. I'm assuming the CLR is loading
into memory (as stated before). Do you still experience the delay
immediately after running? In other words, running it a second time - does
it still run slow?

----- Original Message -----
From: "Andy Smith" <Click here to reveal e-mail address>
To: "aspngcs" <Click here to reveal e-mail address>
Sent: Thursday, June 27, 2002 12:05 AM
Subject: [aspngcs] RE: Slow Execution ?

> i know this sounds silly, but if you are experiencing slow startup times
from windows.forms apps...
[Original message clipped]

----------------------------------------------------------------------------
----

[Original message clipped]

Reply to this message...
 
    
Liz
makes sense, Paul ... but I'm talking about REALLY SLOW ... Andy's
suggestion does seem to fix it, however .... though I have no idea why you
would need an ASPNET account in this context ... seems like a deployment
hassle and a half

Thanks, guys ... I was getting ready to go back to vb6 (well, almost)

L

"Andy Smith" <Click here to reveal e-mail address> wrote in message news:675878@aspngcs...
> i know this sounds silly, but if you are experiencing slow startup times
from windows.forms apps...
[Original message clipped]

Reply to this message...
 
    
Leon P Ford

Read up on the Common Language Runtime (CLR) and the Just-In-Time (JIT)
compile. The new .Net languages are compiled into an Intermediate Language
(IL) and when executed, the CLR does a JIT compile to turn the IL into
Machine Manguage the first time it is executed. After that, it executes
instantaneously. If any changes are made to any of the components, the CLR
will detect them and do another JIT compile to get the updates. I have not
actually written any Windows-based apps using .Net, but I have attended
several MS classes on Visual Studio .Net and attended MS TechEd 2002.
Every introductory session discussed the .Net environment described this.

Hope this helps to explain it.

|---------+--------------------------->
| | "Ken Meads" |
| | <knhmeads@connec|
| | t-a.net> |
| | |
| | 06/27/2002 09:42|
| | Please respond |
| | to "aspngcs" |
| | |
|---------+--------------------------->
>--------------------------------------------------------------------------------------------------------------------------------|
| |
| To: "aspngcs" <Click here to reveal e-mail address> |
| cc: |
| Subject: [aspngcs] RE: Slow Execution ? |
>--------------------------------------------------------------------------------------------------------------------------------|

I know for me, whenever I start a program up for the first time, I can hear
the hard drive a' whirlin' for a 3-5 seconds and then my hello world
appears. But, after that, all is well. I'm assuming the CLR is loading
into memory (as stated before). Do you still experience the delay
immediately after running? In other words, running it a second time - does
it still run slow?

----- Original Message -----
From: "Andy Smith" <Click here to reveal e-mail address>
To: "aspngcs" <Click here to reveal e-mail address>
Sent: Thursday, June 27, 2002 12:05 AM
Subject: [aspngcs] RE: Slow Execution ?

> i know this sounds silly, but if you are experiencing slow startup times
from windows.forms apps...
[Original message clipped]

----------------------------------------------------------------------------

----

[Original message clipped]

| [aspngcs] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngcs.asp = JOIN/QUIT

Reply to this message...
 
    
Leon P Ford
Read up on the Common Language Runtime (CLR) and the Just-In-Time (JIT)
compile. The new .Net languages are compiled into an Intermediate Language
(IL) and when executed, the CLR does a JIT compile to turn the IL into
Machine Language (ML) the first time it is executed. After that, it
executes instantaneously. If any changes are made to any of the
components, the CLR will detect them and do another JIT compile to get the
updates. I have not actually written any Windows-based apps using .Net,
but I have attended several MS classes on Visual Studio .Net and attended
MS TechEd 2002. Every introductory session discussed the .Net environment
described this.

Hope this helps to explain it.

|---------+--------------------------->
| | "Ken Meads" |
| | <knhmeads@connec|
| | t-a.net> |
| | |
| | 06/27/2002 09:42|
| | Please respond |
| | to "aspngcs" |
| | |
|---------+--------------------------->
>--------------------------------------------------------------------------------------------------------------------------------|
| |
| To: "aspngcs" <Click here to reveal e-mail address> |
| cc: |
| Subject: [aspngcs] RE: Slow Execution ? |
>--------------------------------------------------------------------------------------------------------------------------------|

I know for me, whenever I start a program up for the first time, I can hear
the hard drive a' whirlin' for a 3-5 seconds and then my hello world
appears. But, after that, all is well. I'm assuming the CLR is loading
into memory (as stated before). Do you still experience the delay
immediately after running? In other words, running it a second time - does
it still run slow?

----- Original Message -----
From: "Andy Smith" <Click here to reveal e-mail address>
To: "aspngcs" <Click here to reveal e-mail address>
Sent: Thursday, June 27, 2002 12:05 AM
Subject: [aspngcs] RE: Slow Execution ?

> i know this sounds silly, but if you are experiencing slow startup times
from windows.forms apps...
[Original message clipped]

----------------------------------------------------------------------------

----

[Original message clipped]

| [aspngcs] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngcs.asp = JOIN/QUIT

Reply to this message...
 
    
Little, Ambrose
I was under the impression that it JITs every time it needs to be loaded
into memory. Can someone confirm or deny and explain?

Thanks.

--Ambrose

[Original message clipped]

******************************************************************************
The Company reserves the right to amend statements
made herein in the event of a mistake. Unless expressly
stated herein to the contrary, only agreements in writing signed
by an authorized officer of the Company may be enforced against it.
*******************************************************************************

Reply to this message...
 
    
joseph.gaus@dowcorning.com
I would also like to see an answer to Ambrose's question, I have actually
heard conflicting answers on the topic in the past. Are compiled copies
stored in cache between executions of an application, or does it JIT each
time an application is loaded?

-Joe

-----Original Message-----
From: Little, Ambrose [mailto:Click here to reveal e-mail address]
Sent: Thursday, June 27, 2002 2:16 PM
To: aspngcs
Subject: [aspngcs] RE: Slow Execution ?

I was under the impression that it JITs every time it needs to be loaded
into memory. Can someone confirm or deny and explain?

Thanks.

--Ambrose

[Original message clipped]

****************************************************************************
**
The Company reserves the right to amend statements
made herein in the event of a mistake. Unless expressly
stated herein to the contrary, only agreements in writing signed
by an authorized officer of the Company may be enforced against it.
****************************************************************************
***

| [aspngcs] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngcs.asp = JOIN/QUIT

________________________________________________________________________
This email has been scanned for all viruses by the MessageLabs SkyScan
service. For more information on a proactive anti-virus service working
around the clock, around the globe, visit http://www.messagelabs.com
________________________________________________________________________

________________________________________________________________________
This email has been scanned for all viruses by the MessageLabs SkyScan
service. For more information on a proactive anti-virus service working
around the clock, around the globe, visit http://www.messagelabs.com
________________________________________________________________________

Reply to this message...
 
    
Sills, Adam
[Original message clipped]

You are correct. Whenever a .NET application loads and gets put into an
AppDomain, it is JITted (actually only the methods that are called are
JITted). When the application shuts down, it gets unloaded from memory and
the next time you execute your application it JITs again. The same is true
with ASP.NET. Shut down your webserver (or kill the aspnet_wp.exe process)
and you'll watch your entire application JIT again.

[Original message clipped]

However, the moment it is unloaded it gets removed from memory and will
re-JIT.

[Original message clipped]

Nope. ASP.NET only here. Since your JITted assemblies are actually located
elsewhere (memory and in the web cache), ASP.NET's file system watcher
detects the new assembly and phases out the previously JITted assembly. This
was only built into ASP.NET as typically the only type of application that
needs this functionality is your "always-up" style web application.

Adam..

Reply to this message...
 
    
Sills, Adam
Just to further iterate my point (I had to double-check myself after I
sent). Create a class (myclass.cs):
namespace MyNs {
    public class MyClass {
        public void DoSomething() {
            System.Console.WriteLine("Hello from MyClass!");
        }
    }
}

Build it with
csc /t:library myclass.cs

Create your application class (myapp.cs):
using System;
using MyNs;

namespace MyAppNs {
    public class MyAppNs {
        public static void Main() {
            MyClass c = new MyClass();
            c.DoSomething();
            Console.WriteLine("Okay, recompile your referenced
assembly");
            Console.WriteLine("Press enter to finish");
            Console.ReadLine();
        }
    }
}

Build it with
csc /t:exe /r:myclass.dll myapp.cs

Now from the console run myapp.exe. Open another console window, and try to
recompile myclass.cs. You get a File IO error, because the assembly is in
use and cannot be overwritten. Hence, windows forms applications do not have
the functionality of being able to drop in new versions of assemblies while
the application is running.

Adam..

-----Original Message-----
From: Sills, Adam [mailto:Click here to reveal e-mail address]
Sent: Thursday, June 27, 2002 2:48 PM
To: aspngcs
Subject: [aspngcs] RE: Slow Execution ?

[Original message clipped]

You are correct. Whenever a .NET application loads and gets put into an
AppDomain, it is JITted (actually only the methods that are called are
JITted). When the application shuts down, it gets unloaded from memory and
the next time you execute your application it JITs again. The same is true
with ASP.NET. Shut down your webserver (or kill the aspnet_wp.exe process)
and you'll watch your entire application JIT again.

[Original message clipped]

However, the moment it is unloaded it gets removed from memory and will
re-JIT.

[Original message clipped]

Nope. ASP.NET only here. Since your JITted assemblies are actually located
elsewhere (memory and in the web cache), ASP.NET's file system watcher
detects the new assembly and phases out the previously JITted assembly. This
was only built into ASP.NET as typically the only type of application that
needs this functionality is your "always-up" style web application.

Reply to this message...
 
    
Glavich, Paul C
I'll second Adams opinion. Its like when you have an ASP.NET app running and
you replace a DLL or change any component. First accesses are quite slow as
its all re JITed and loaded into memory, then everything flies along.

* Paul Glavich
Professional Web Services
Email: Click here to reveal e-mail address
(Currently no fixed phone or street address)

-----Original Message-----
From: Sills, Adam [mailto:Click here to reveal e-mail address]
Sent: Friday, 28 June 2002 4:58 AM
To: aspngcs
Subject: [aspngcs] RE: Slow Execution ?

Just to further iterate my point (I had to double-check myself after I
sent). Create a class (myclass.cs): namespace MyNs {
    public class MyClass {
        public void DoSomething() {
            System.Console.WriteLine("Hello from MyClass!");
        }
    }
}

Build it with
csc /t:library myclass.cs

Create your application class (myapp.cs):
using System;
using MyNs;

namespace MyAppNs {
    public class MyAppNs {
        public static void Main() {
            MyClass c = new MyClass();
            c.DoSomething();
            Console.WriteLine("Okay, recompile your referenced
assembly");
            Console.WriteLine("Press enter to finish");
            Console.ReadLine();
        }
    }
}

Build it with
csc /t:exe /r:myclass.dll myapp.cs

Now from the console run myapp.exe. Open another console window, and try to
recompile myclass.cs. You get a File IO error, because the assembly is in
use and cannot be overwritten. Hence, windows forms applications do not have
the functionality of being able to drop in new versions of assemblies while
the application is running.

Adam..

-----Original Message-----
From: Sills, Adam [mailto:Click here to reveal e-mail address]
Sent: Thursday, June 27, 2002 2:48 PM
To: aspngcs
Subject: [aspngcs] RE: Slow Execution ?

[Original message clipped]

You are correct. Whenever a .NET application loads and gets put into an
AppDomain, it is JITted (actually only the methods that are called are
JITted). When the application shuts down, it gets unloaded from memory and
the next time you execute your application it JITs again. The same is true
with ASP.NET. Shut down your webserver (or kill the aspnet_wp.exe process)
and you'll watch your entire application JIT again.

[Original message clipped]

However, the moment it is unloaded it gets removed from memory and will
re-JIT.

[Original message clipped]

Nope. ASP.NET only here. Since your JITted assemblies are actually located
elsewhere (memory and in the web cache), ASP.NET's file system watcher
detects the new assembly and phases out the previously JITted assembly. This
was only built into ASP.NET as typically the only type of application that
needs this functionality is your "always-up" style web application.

| [aspngcs] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngcs.asp = JOIN/QUIT

Reply to this message...
 
    
Glavich, Paul C
Hi Andy, do you have any more links to this? This has me curious and I
haven't seen this before.

* Paul Glavich
Professional Web Services
Email: <mailto:Click here to reveal e-mail address> Click here to reveal e-mail address
(Currently no fixed phone or street address)
-----Original Message-----
From: Andy Smith [mailto:Click here to reveal e-mail address]
Sent: Thursday, 27 June 2002 4:05 PM
To: aspngcs
Subject: RE: [aspngcs] Slow Execution ?

i know this sounds silly, but if you are experiencing slow startup times
from windows.forms apps...
make sure you have an user account named "ASPNET"

i realize your aren't talking about web applications... but I've heard
reports that this fixes the situation.

if this is not the nature of your "SLOW" report... could you be more
specific?

-----Original Message-----
From: Liz [mailto:Click here to reveal e-mail address]
Sent: Wed 6/26/2002 9:23 PM
To: aspngcs
Cc:
Subject: [aspngcs] Slow Execution ?

Hi ...

I'm just getting started with some REALLY simple C# workouts ... "Hello
World" stuff ... compile is fine but the execution is SLOW ... I experienced
the same thing fooling around with Win VB.NET simple apps

I'm talking about .EXE console apps here ... when I do the same things in
ASP.NET exec is fast after the first page request/compile ...

any thoughts out there ? thanks ...

| [aspngcs] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngcs.asp
<http://www.asplists.com/asplists/aspngcs.asp> = JOIN/QUIT
Reply to this message...
 
    
Andy Smith
check out this google news search result
http://groups.google.com/groups?q=.net+startup+time+aspnet+account <http://groups.google.com/groups?q=.net+startup+time+aspnet+account&hl=en&lr=&ie=UTF-8&oe=UTF8&selm=Owv039CDCHA.1108%40tkmsftngp04&rnum=1> &hl=en&lr=&ie=UTF-8&oe=UTF8&selm=Owv039CDCHA.1108%40tkmsftngp04&rnum=1

apparently it is a known-issue, with no KB article, and will be fixed in the next SP.

__
Andy Smith
Keyboard Jockey #3a7-2.78.1

-----Original Message-----
From: Glavich, Paul C [mailto:Click here to reveal e-mail address]
Sent: Thursday, June 27, 2002 4:39 PM
To: aspngcs
Subject: [aspngcs] RE: Slow Execution ?

Hi Andy, do you have any more links to this? This has me curious and I haven't seen this before.

* Paul Glavich
Professional Web Services
Email: <mailto:Click here to reveal e-mail address> Click here to reveal e-mail address
(Currently no fixed phone or street address)
-----Original Message-----
From: Andy Smith [mailto:Click here to reveal e-mail address]
Sent: Thursday, 27 June 2002 4:05 PM
To: aspngcs
Subject: RE: [aspngcs] Slow Execution ?

i know this sounds silly, but if you are experiencing slow startup times from windows.forms apps...
make sure you have an user account named "ASPNET"

i realize your aren't talking about web applications... but I've heard reports that this fixes the situation.

if this is not the nature of your "SLOW" report... could you be more specific?

-----Original Message-----
From: Liz [mailto:Click here to reveal e-mail address]
Sent: Wed 6/26/2002 9:23 PM
To: aspngcs
Cc:
Subject: [aspngcs] Slow Execution ?

Hi ...

I'm just getting started with some REALLY simple C# workouts ... "Hello
World" stuff ... compile is fine but the execution is SLOW ... I experienced
the same thing fooling around with Win VB.NET simple apps

I'm talking about .EXE console apps here ... when I do the same things in
ASP.NET exec is fast after the first page request/compile ...

any thoughts out there ? thanks ...

| [aspngcs] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngcs.asp = JOIN/QUIT

| [aspngcs] member Click here to reveal e-mail address = YOUR ID | http://www.asplists.com/asplists/aspngcs.asp = JOIN/QUIT
Reply to this message...
 
 
System.AppDomain
System.Console




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification