- 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
- Python絕技:運用Python成為頂級數據工程師
- Voice Application Development for Android
- R數據科學實戰:工具詳解與案例分析(鮮讀版)
- 數據架構與商業智能
- 大數據營銷:如何讓營銷更具吸引力
- Starling Game Development Essentials
- 大數據技術入門
- 達夢數據庫運維實戰
- SQL Server 2012數據庫管理教程
- 利用Python進行數據分析(原書第2版)
- Scratch 2.0 Game Development HOTSHOT
- 大數據測試技術:數據采集、分析與測試實踐(在線實驗+在線自測)
- 深入理解Flink:實時大數據處理實踐
- 掌中寶:電腦綜合應用技巧
- 大數據理論與工程實踐