Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Native AOT: Re-order method bodies using PGO data #114093

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Tracked by #114179
agocke opened this issue Apr 1, 2025 · 5 comments · Fixed by #114736
Closed
Tracked by #114179

Native AOT: Re-order method bodies using PGO data #114093

agocke opened this issue Apr 1, 2025 · 5 comments · Fixed by #114736
Assignees
Milestone

Comments

@agocke
Copy link
Member

agocke commented Apr 1, 2025

Right now Native AOT only uses PGO data to affect intra-body optimization opportunities. If method bodies were re-ordered, we could reduce the memory usage of many programs by putting all the "hot" methods into pages at the beginning of the image and cold methods at the end.

There are further possible improvements, but even a naive approach would be worth exploring.

@dotnet-issue-labeler dotnet-issue-labeler bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Apr 1, 2025
@agocke agocke added this to the 10.0.0 milestone Apr 1, 2025
@agocke agocke added area-NativeAOT-coreclr and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels Apr 1, 2025
Copy link
Contributor

Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas
See info in area-owners.md if you want to be subscribed.

@HighPerfDotNet
Copy link

What PGO data Native AOT use, is it different from static PGO tool referenced here -

#95236

@agocke
Copy link
Member Author

agocke commented Apr 1, 2025

No different, same file. This isn’t a supportedw scenario yet.

@jakobbotsch
Copy link
Member

crossgen2 has an existing implementation of Pettis-Hansen that could be leveraged: https://github.com/dotnet/runtime/blob/main/src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/PettisHansenSort/PettisHansen.cs

@HighPerfDotNet
Copy link

No different, same file. This isn’t a supportedw scenario yet.

It would be awfully nice to get working supported static PGO solution for Native AOT ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

Successfully merging a pull request may close this issue.

4 participants