Skip to content

Commit 3efff3f

Browse files
authored
Clarify profile optimization requirements and benefits (#12494)
Updated remarks to clarify the requirements and benefits of profile optimization.
1 parent 6dac9a9 commit 3efff3f

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

xml/System.Runtime/ProfileOptimization.xml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,18 @@
4444
4545
## Remarks
4646
47-
> [!IMPORTANT]
48-
> Profile optimization requires a multicore computer. The methods are ignored on other computers.
47+
> [!NOTE]
48+
>
49+
> - Profile optimization requires a multicore computer. The methods are ignored on other computers.
50+
> - This API reduces startup time. These improvements are complementary to [dynamic profile-guided optimization (Dynamic PGO)](/dotnet/core/whats-new/dotnet-6#profile-guided-optimization), which improves runtime optimization based on observed execution patterns.
4951
5052
Each time you initiate profile optimization in an application domain, the profile that was created during the previous use is read. The information in the profile is used to guide background compilation by identifying the methods that are most likely to be executed during startup. On multicore computers, this increases the chances that a method is already compiled by the time it is needed so that the main application thread does not have to call the JIT compiler.
5153
5254
The profile file is overwritten on each use, so it always contains the most recent information about which methods are used during startup.
5355
54-
Optimization profiles are not restricted to application domain startup. They can be used for any activity that will require heavy use of the JIT compiler. You can maintain multiple profiles for an application domain so that each such activity has its own profile.
56+
Optimization profiles are not restricted to application domain startup. They can be used for any activity that requires heavy use of the JIT compiler. You can maintain multiple profiles for an application domain so that each such activity has its own profile.
5557
56-
To use optimization profiles in an application domain, you must call the <xref:System.Runtime.ProfileOptimization.SetProfileRoot%2A> method and specify the folder where profiles are stored. The folder must already exist. To begin using a profile, call the <xref:System.Runtime.ProfileOptimization.StartProfile%2A> method and specify the file name of the profile. If the file was not recorded previously, it is created on first use. There is no performance benefit the first time a profile is created.
58+
To use optimization profiles in an application domain, you must call the <xref:System.Runtime.ProfileOptimization.SetProfileRoot%2A> method and specify the folder where profiles are stored. The folder must already exist. To begin using a profile, call the <xref:System.Runtime.ProfileOptimization.StartProfile%2A> method and specify the file name of the profile. If the file was not recorded previously, it's created on first use. There is no performance benefit the first time a profile is created.
5759
5860
Profile optimization does not change the order in which methods are executed. Methods are not executed on the background thread; if a method is compiled but never called, it is simply not used. If a profile file is corrupt or cannot be written to the specified folder (for example, because the folder does not exist), program execution continues without optimization profiling.
5961

0 commit comments

Comments
 (0)