# Profile Guided Optimization Comes to .NET Core

| by Jeff Martin 17 Followers on Jul 27, 2017. Estimated reading time: 1 minute |

Profile Guided Optimization (PGO) is a native compilation technology used to generate more highly optimized code.  It accomplishes this through a two-step compilation process-- using a first step to record information about execution then a second step that uses that information to build an improved binary.  According to Microsoft's Daniel Podder and Bertrand Le Roy, the historic benefit realized from this process is an improvement in laying out a binary's code in the image which results in better working and reference set locality.

A strong reason to implement PGO in .NET Core is that users do not need to take any special actions to benefit from PGO as it is applied to the .NET Core runtime and JIT compiler.  Consequently managed applications will automatically benefit although exact improvements depend on a given application and its usage.

For this release, Podder and Le Roy state that PGO optimizations have been applied to the native parts of the .NET Core runtime, but in the future these optimizations will be made to the managed components of the .NET Core stack . Unlike the PGO optimizations released for .NET Core 1.1 which were Windows x86 only, these latest optimizations have been expanded to include Windows x64 and Linux x64.

Since more than 75% of an .NET Core application's startup time was spent in coreclr.dll and clrjit.dll (on Linux these are libcoreclr.so and libclrjit.so), that is where the team sought to measure and then improve performance.  Based on Microsoft's benchmarks, significant improvement was made on the Windows platform (both x64 & x86) ranging from 14% to 23%.  On the other hand, improvements for Linux x64 ranged from 2% to 5%.  While it is important to see that Linux did not regress with PGO enabled, it also indicates room remains for greater improvements in the future.

According to a Microsoft’s spokesperson, Windows and Linux are considered key deployment targets and as such were positioned to receive PGO technology first.  Additional platforms such as macOS will be considered in the future based on user feedback.

Style

## Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

## Get the most out of the InfoQ experience.

### Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread
Close

#### by

on

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Discuss

Login to InfoQ to interact with what matters most to you.