Skip to content

Add C instrumentation to native libs (Native PGO) - #67820

Closed
EgorBo wants to merge 5 commits into
dotnet:mainfrom
EgorBo:pgo-native-libs
Closed

EgorBo wants to merge 5 commits into
dotnet:mainfrom
EgorBo:pgo-native-libs

Conversation

@EgorBo

@EgorBo EgorBo commented Apr 10, 2022 •

Copy link
Copy Markdown
Member

Closes #67671

Currently we instrument only coreclr and clrjit binaries (clrgc is included into coreclr).

This PR enables native (C) instrumentation for native libs. So far, I only tested BrotliStream and already can see 4-7% performance improvements for compress/decompress scenarios (see #67671 (comment)) I expect to see improvements in Zlib and, probably, tiny improvements in complex wrappers around icu, openssl, etc.

if this is merged I'll add a compress/decompress training scenario to dotnet-optimization.

size of libSystem.IO.Compression.Native.so:

  • default: 864kb
  • instrumented: 1.2Mb
  • instrumented with -O0: 1.6Mb
  • optimized with profdata: 776kb

@ghost ghost assigned EgorBo Apr 10, 2022
@ghost

ghost commented Apr 10, 2022

Copy link
Copy Markdown

I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label.

@danmoseley

Copy link
Copy Markdown
Contributor

Cc @brianrob

@brianrob

Copy link
Copy Markdown
Member

@EgorBo, this is great. You should also enforce that PGO data is properly applied via a call to pgocheck.py. See https://github.com/dotnet/runtime/blob/main/src/coreclr/build-runtime.cmd#L409 for an example. Note that release builds will not succeed once you do this unless there is PGO in the packages to apply for these binaries, so you'll have to pre-merge your changes to dotnet-optimization prior to merging this PR.

@ghost

ghost commented Apr 28, 2022

Copy link
Copy Markdown

Tagging subscribers to this area: @dotnet/area-infrastructure-libraries
See info in area-owners.md if you want to be subscribed.

Issue Details

Closes #67671

Currently we instrument only coreclr and clrjit binaries (clrgc is included into coreclr).

This PR enables native (C) instrumentation for native libs. So far, I only tested BrotliStream and already can see 4-7% performance improvements for compress/decompress scenarios (see #67671 (comment)) I expect to see improvements in Zlib and, probably, tiny improvements in complex wrappers around icu, openssl, etc.

if this is merged I'll add a compress/decompress training scenario to dotnet-optimization.

size of libSystem.IO.Compression.Native.so:

  • default: 864kb
  • instrumented: 1.2Mb
  • instrumented with -O0: 1.6Mb
  • optimized with profdata: 776kb
Author: EgorBo
Assignees: EgorBo
Labels:

area-Infrastructure-libraries

Milestone: -

@danmoseley

Copy link
Copy Markdown
Contributor

Do we have an idea how good our PGO training coverage is for these libraries?

@ghost ghost closed this May 28, 2022
@ghost

ghost commented May 28, 2022

Copy link
Copy Markdown

Draft Pull Request was automatically closed for 30 days of inactivity. Please let us know if you'd like to reopen it.

@ghost ghost locked as resolved and limited conversation to collaborators Jun 28, 2022
This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Native PGO: more targets

3 participants