Performance Improvements in .NET 8 — JIT partial translation
Performance Improvements in .NET 8 — JIT partial translation Related video Dynamic PGO Benchmark settings In this article, I include microbenchmarks to highlight various aspects of the discussion. Most of these benchmarks were implemented using BenchmarkDotNet v0.13.8, and unless otherwise noted, each benchmark has a simple setup. To follow this article, first make sure you have .NET 7 and .NET 8 installed. For this article, I used the .NET 8 Release Candidate (8.0.0-rc.1.23419.4). After completing these prerequisites, create a new C# project in the new baseline directory: dotnet new console -o benchmarks cd benchmarks This directory will contain two files: benchmarks.csproj (the project file that contains information about how the application should be built) and Program.cs (the application’s code). Replace the entire contents of benchmarks.csproj with the following: Exe net8.0;net7.0 Preview enable true true The above project files tell the build system that we want: Build a runnable application (not a library); Ability to run on .NET 8 and .NET 7 (so that BenchmarkDotNet can run multiple processes, one with .NET 7 and one with .NET 8, to be able to compare results); Even if C# 12 has not yet been officially released, you can still use all the latest…