ASP.NET application on IIS7 - very slow startup after iisreset

后端 未结 7 1866
长发绾君心
长发绾君心 2021-02-05 16:41

I have an ASP.NET 3.5 website running under IIS7 on Windows 2008.

When I restart IIS (iisreset), then hit a page, the initial startup is really slow.

I see the f

7条回答
  •  北恋
    北恋 (楼主)
    2021-02-05 17:31

    IL is being converted into machine native code (Assembly) by the Just-In-Time compiler and you get to wait while all the magic happens.

    When compiling the source code to managed code, the compiler translates the source into Microsoft intermediate language (MSIL). This is a CPU-independent set of instructions that can efficiently be converted to native code. Microsoft intermediate language (MSIL) is a translation used as the output of a number of compilers. It is the input to a just-in-time (JIT) compiler. The Common Language Runtime includes a JIT compiler for the conversion of MSIL to native code.

    Before Microsoft Intermediate Language (MSIL) can be executed it, must be converted by the .NET Framework just-in-time (JIT) compiler to native code. This is CPU-specific code that runs on the same computer architecture as the JIT compiler. Rather than using time and memory to convert all of the MSIL in a portable executable (PE) file to native code. It converts the MSIL as needed whilst executing, then caches the resulting native code so its accessible for any subsequent calls.

    source

提交回复
热议问题