- C# 7 and .NET Core 2.0 High Performance
- Ovais Mehboob Ahmed Khan
- 257字
- 2021-08-27 18:47:13
From compilation to execution – Under the hood
The .NET Core compilation process is like the one used with the .NET Framework. When the project is built, the internal .NET CLI command is invoked by the MSBuild system, which builds the project and generates the assembly (.dll) or executable (.exe) file. This assembly contains the manifest that contains the assembly's metadata, and includes the version number, culture, type-reference information, information about the referenced assemblies, and a list of other files in the assembly and their association. This assembly manifest is stored either in the MSIL code or in a standalone portable executable (PE) file:

Now, when the executable is run, a new process is started and bootstraps the .NET Core runtime, which then initializes the execution environment, sets up the heap and thread pool, and loads the assembly into the process address space. Based on the program, it then executes the main entry point method (Main) and performs a JIT compilation. From here, the code starts executing and the objects start allocating memory on heap, where primitive types store on stack. For each method, the JIT compilation is done and the native machine code gets generated.
When JIT compilation is done, and before generating a native machine code, however, it also performs a few validations. These validations include the following:
- Verifying, that the MSIL was generated during the build process
- Verifying, whether any code was modified or new types added during the JIT compilation process
- Verifying, that the optimized code for the target machine has been generated
- 漫話大數(shù)據(jù)
- 數(shù)據(jù)庫(kù)應(yīng)用實(shí)戰(zhàn)
- 信息系統(tǒng)與數(shù)據(jù)科學(xué)
- App+軟件+游戲+網(wǎng)站界面設(shè)計(jì)教程
- 深入淺出MySQL:數(shù)據(jù)庫(kù)開(kāi)發(fā)、優(yōu)化與管理維護(hù)(第2版)
- 大數(shù)據(jù)技術(shù)入門
- gnuplot Cookbook
- Power BI智能數(shù)據(jù)分析與可視化從入門到精通
- 視覺(jué)大數(shù)據(jù)智能分析算法實(shí)戰(zhàn)
- Oracle數(shù)據(jù)庫(kù)管理、開(kāi)發(fā)與實(shí)踐
- 智慧城市中的大數(shù)據(jù)分析技術(shù)
- 企業(yè)級(jí)大數(shù)據(jù)項(xiàng)目實(shí)戰(zhàn):用戶搜索行為分析系統(tǒng)從0到1
- 區(qū)塊鏈應(yīng)用開(kāi)發(fā)指南:業(yè)務(wù)場(chǎng)景剖析與實(shí)戰(zhàn)
- 大數(shù)據(jù)隱私保護(hù)技術(shù)與治理機(jī)制研究
- 領(lǐng)域驅(qū)動(dòng)設(shè)計(jì)精粹