If there is a large web application, consider performing pre-compiled compilation

xiaoxiao2021-03-06  122

Batch compilation is performed whenever the first request for the directory. If the page in the directory is not analyzed and compiled, this feature will be batch and compile all the pages in the directory to better utilize disks and memory. If this takes a long time, the single page will be quickly analyzed and compiled so that the request can be processed. This feature gives ASP.NET performance because it compiles many pages as a single assembly. Access from the loaded assembly is fast than each page loads a new assembly.

The disadvantage of compilation is that if the server receives many requests that have not been compiled, the performance may be poor when the web server is analyzed and compiled. To solve this problem, you can perform pre-compiled compilation. To this end, just request a page to it before the application is activated, no matter which page can be. Then, the page and its assembly will have been compiled when the user first accesses your site for the first time.

There is no simple mechanism to know when batch compilation occurs. Need to wait until the CPU is idle or there is no more compiler process (such as CSC.EXE (C # compiler) or VBC.exe (Visual Basic Compiler)).

It should also be avoided to avoid changing the assembly in the / bin directory of the application. Changing the page will result in re-analyze and compile this page, and the assembly in the replacement / bin directory will result in full re-approvement of the directory.

On a large-scale site containing many pages, a better way may design different directory structures based on the frequently scheduled replacement page or assembly. The page that is not often changed can be stored in the same directory and perform pre-compiled time at a specific time. The frequent changes page should be in their own directory (up to hundreds of pages per directory) for quick compilation.

The web application can contain many subdirectories. Batch compilation occurs in the directory level, not the application level.

转载请注明原文地址:https://www.9cbs.com/read-101641.html

New Post(0)