Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net (http://www.velocityreviews.com/forums/f29-asp-net.html)
-   -   Startup delay due to compiling (http://www.velocityreviews.com/forums/t621802-startup-delay-due-to-compiling.html)

Chris Zopers 06-23-2008 01:31 PM

Startup delay due to compiling
 
Hello,

To prevent my webapplication from compiling when a user first visit's
the site, I precompile the application with the aspnet_compiler tool
(aspnet_compiler -p physicalOrRelativePath -v / targetPath).

When the application ends/stops because of inactivity for a while, it
still takes some time when a user tries to access the site again. This
is only on the first visit after the site has stopped, after that
everything works fine and fast. FYI, I do not use any code in the
Application_Start event, so that can't be the problem.

Anyone got an idea, am I doing something wrong perhaps with the compiler
tool?

Greetings,
Chris

*** Sent via Developersdex http://www.developersdex.com ***

Mark Fitzpatrick 06-23-2008 01:36 PM

Re: Startup delay due to compiling
 
No, you're not doing anything wrong, this is the way it is. You compile the
site into Intermediate Language (IL). When the application starts up, it
compiles it into machine language and caches that and assigns resources.
Part of the delay is just the application starting up again regardless of
anything going on in the Application_Start event.

Hope this helps,
Mark Fitzpatrick
Microsoft MVP - Expression

"Chris Zopers" <test123test12@12move.nl> wrote in message
news:eY7unVT1IHA.4704@TK2MSFTNGP05.phx.gbl...
> Hello,
>
> To prevent my webapplication from compiling when a user first visit's
> the site, I precompile the application with the aspnet_compiler tool
> (aspnet_compiler -p physicalOrRelativePath -v / targetPath).
>
> When the application ends/stops because of inactivity for a while, it
> still takes some time when a user tries to access the site again. This
> is only on the first visit after the site has stopped, after that
> everything works fine and fast. FYI, I do not use any code in the
> Application_Start event, so that can't be the problem.
>
> Anyone got an idea, am I doing something wrong perhaps with the compiler
> tool?
>
> Greetings,
> Chris
>
> *** Sent via Developersdex http://www.developersdex.com ***



Chris Zopers 06-23-2008 01:49 PM

Re: Startup delay due to compiling
 
Okey, so not using the compiler tool would mean that on the first visit
the site will be compiled to IL and after that to machine language (two
times compiling) and using the compiler tool would mean that the first
compiliation (into IL) does not have to take place anymore? Am I getting
this right? So using the compiler tool would improve the startup time a
bit by eliminating the compilation into IL?

Greetings,
Chris




*** Sent via Developersdex http://www.developersdex.com ***

Madhur 06-23-2008 01:59 PM

Re: Startup delay due to compiling
 
You may try doing the NGEN to obtain the machine code beforehand.

--
Madhur

"Chris Zopers" <test123test12@12move.nl> wrote in message
news:Ox0grfT1IHA.4948@TK2MSFTNGP02.phx.gbl...
> Okey, so not using the compiler tool would mean that on the first visit
> the site will be compiled to IL and after that to machine language (two
> times compiling) and using the compiler tool would mean that the first
> compiliation (into IL) does not have to take place anymore? Am I getting
> this right? So using the compiler tool would improve the startup time a
> bit by eliminating the compilation into IL?
>
> Greetings,
> Chris
>
>
>
>
> *** Sent via Developersdex http://www.developersdex.com ***



BWC 06-23-2008 02:04 PM

Re: Startup delay due to compiling
 
That's correct.

You can control the delay you're experiencing with the JIT compiler, by
modifying the web.config setting for compilation. Setting batch="false" will
cause each page to be compiled individually as it is first requested - rather
than compiling a number of pages into machine specific binaries.

<compilation batch="false">

You can also configure the batch size, and other details.
http://msdn.microsoft.com/en-us/library/s10awwz0.aspx

Best of luck,
BWC

"Chris Zopers" wrote:

> Okey, so not using the compiler tool would mean that on the first visit
> the site will be compiled to IL and after that to machine language (two
> times compiling) and using the compiler tool would mean that the first
> compiliation (into IL) does not have to take place anymore? Am I getting
> this right? So using the compiler tool would improve the startup time a
> bit by eliminating the compilation into IL?
>
> Greetings,
> Chris
>
>
>
>
> *** Sent via Developersdex http://www.developersdex.com ***
>



All times are GMT. The time now is 06:05 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.