ValveSoftware / SteamOS

SteamOS community tracker
1.56k stars 70 forks source link

Evaluate using Profile-Guided Optimization (PGO) and Post-Link Optimization (PLO) for SteamOS #1287

Closed zamazan4ik closed 9 months ago

zamazan4ik commented 9 months ago

This issue is not exactly about the problem - it's just an idea of how to improve SteamOS performance and UX and battery life for SteamDeck.

I can imagine multiple things where PGO can shine in SteamOS:

Maybe they are valuable for SteamOS applications. Here I collect as many PGO cases as I can find - you can check them and find more other applications.

kisak-valve commented 9 months ago

Hello @zamazan4ik, this is a recurring topic among many open source projects. The general outcome is that you can make one very specific use case marginally better while harming almost all other use cases and sometimes creates some extremely poor performance results when the profile used to compile doesn't match reality.

When generalized to an entire OS install, this is a sink hole to burn developer time and isn't worth looking into. The time spent tuning profiles is better spent integrating newer package versions which have picked up optimizations as part of their upstream maintenance. If there's a specific and significant performance improvement to be found in a specific project, then contribute it upstream for everybody to benefit.

zamazan4ik commented 9 months ago

marginally better

I have a lot of examples where the outcome is significant, not marginal. All the benchmarks you can check here (the same link was in the first message).

while harming almost all other use cases

It's not true if you are using several profiles from different workloads and use all of them simultaneously to create one PGO build (it could be done via merging several PGO profiles into one via dedicated tooling like llvm-profdata merge).

sometimes creates some extremely poor performance results when the profile used to compile doesn't match reality.

I do agree. However, it is usually simply mitigated by adding this profile to the PGO training set as well.

When generalized to an entire OS install, this is a sink hole to burn developer time and isn't worth looking into. The time spent tuning profiles is better spent integrating newer package versions which have picked up optimizations as part of their upstream maintenance. If there's a specific and significant performance improvement to be found in a specific project, then contribute it upstream for everybody to benefit.

Yeah, makes sense. Thanks a lot for the answer!