Startup delay due to compiling

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Chris Zopers

    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_compile r -p physicalOrRelat ivePath -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_Sta rt 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

    #2
    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_Sta rt event.

    Hope this helps,
    Mark Fitzpatrick
    Microsoft MVP - Expression

    "Chris Zopers" <test123test12@ 12move.nlwrote in message
    news:eY7unVT1IH A.4704@TK2MSFTN GP05.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_compile r -p physicalOrRelat ivePath -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_Sta rt 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 ***

    Comment

    • Chris Zopers

      #3
      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 ***

      Comment

      • Madhur

        #4
        Re: Startup delay due to compiling

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

        --
        Madhur

        "Chris Zopers" <test123test12@ 12move.nlwrote in message
        news:Ox0grfT1IH A.4948@TK2MSFTN GP02.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 ***

        Comment

        • =?Utf-8?B?QldD?=

          #5
          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.


          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 ***
          >

          Comment

          Working...