Startup delay due to compiling

Discussion in 'ASP .Net' started by Chris Zopers, Jun 23, 2008.

  1. Chris Zopers

    Chris Zopers Guest

    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, Jun 23, 2008
    #1
    1. Advertising

  2. 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" <> wrote in message
    news:...
    > 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, Jun 23, 2008
    #2
    1. Advertising

  3. Chris Zopers

    Chris Zopers Guest

    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 ***
    Chris Zopers, Jun 23, 2008
    #3
  4. Chris Zopers

    Madhur Guest

    You may try doing the NGEN to obtain the machine code beforehand.

    --
    Madhur

    "Chris Zopers" <> wrote in message
    news:...
    > 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, Jun 23, 2008
    #4
  5. Chris Zopers

    BWC Guest

    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 ***
    >
    BWC, Jun 23, 2008
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Tim Ward

    Delay in thread startup?

    Tim Ward, Oct 16, 2003, in forum: Java
    Replies:
    1
    Views:
    1,484
    Tim Ward
    Oct 16, 2003
  2. Fresh
    Replies:
    2
    Views:
    624
    Bo Persson
    Apr 22, 2008
  3. Garrett Cooper
    Replies:
    0
    Views:
    545
    Garrett Cooper
    Feb 24, 2009
  4. David J. Berman

    Web Services client software has substantial delay on startup

    David J. Berman, Aug 2, 2007, in forum: ASP .Net Web Services
    Replies:
    9
    Views:
    285
  5. Gary Hasler
    Replies:
    12
    Views:
    198
    Thomas 'PointedEars' Lahn
    Feb 19, 2010
Loading...

Share This Page