Skip to content
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

Document micro-optimizations that should be done before final game release #4586

Open
alice-i-cecile opened this issue Apr 25, 2022 · 5 comments
Labels
A-Cross-Cutting Impacts the entire engine C-Docs An addition or correction to our documentation C-Performance A change motivated by improving speed, memory usage or compile times

Comments

@alice-i-cecile
Copy link
Member

How can Bevy's documentation be improved?

Several performance optimizations can be done just before final release, but are impractical for development.

As a starting point:

These should be documented in a single central place.

@alice-i-cecile alice-i-cecile added C-Docs An addition or correction to our documentation C-Performance A change motivated by improving speed, memory usage or compile times A-Meta About the project itself labels Apr 25, 2022
@Nilirad
Copy link
Contributor

Nilirad commented Apr 25, 2022

I thought about two things:

  1. Having an optimization chapter toward the end of the book.
  2. Having our own Bevy CLI, that would essentially be a cargo wrapper that extends the toolchain.

One of the CLI commands could be something like bevy deploy that applies all the optimizations and creates the optimized app packaged with all assets. But that could be its own issue or even an RFC.

There is already an issue about a Bevy CLI:

@mockersf
Copy link
Member

there is also #1885

@SamPruden
Copy link

Does compiling with PGO make sense? Perhaps it would "overfit" on the characteristics of the gameplay scenarios that the tests are run on, and perform worse in other circumstances. Advice on this might be worth a mention in this section either way.

I expect the advice would be "Don't compile with PGO unless you've comprehensively benchmarked that it helps and doesn't hinder", but I've not run any tests to see if that's right.

@alice-i-cecile
Copy link
Member Author

Yep, that's about my current feelings. PGO is a large domain, and comes with some significant tradeoffs and variability.

I think that the big wins here are likely to be found with schedule optimization, which is opaque to the compiler. But that's a problem for several years from now.

@zamazan4ik
Copy link

zamazan4ik commented Aug 11, 2023

For history, I want to add some materials regarding PGO to the topic.

I am collecting all materials (benchmarks, articles, stories, showcases, etc.) about PGO across different applications here. I am sure there you would be able to find helpful information regarding PGO.

Related to the gamedev domains, I suggest you look at the following things:

  • I did some benchmarks for Bevy with PGO. PGO-run (first) vs non-PGO (second) - Pastebin. In these results you need to interpret performance decrease as "Release version is slower than PGOed" and performance increase as "Release version is faster than PGOed". As you see, in many scenarios PGO improves performance, but in some of them performance is decreased.
  • Unreal Engine supports PGO build since 4.27 (release notes). According to the documentation, PGO allows to achieve better performance on UE too (+10% on some CPU-heavy scenarios from this page). Also, I've talked with developers in a local Telegram chat about UE. A person said that they use PGO as a default optimization with UE and their games. The PGO profiles are collected via crafted local test workloads (usually - the most difficult scenes) with Gauntlet. The performance improvement is something like 6-8%
  • Godot proposal about PGO - link
  • Unity Burst thread about PGO - link

Hope it could help with PGO story for Bevy.

@alice-i-cecile alice-i-cecile added A-Cross-Cutting Impacts the entire engine and removed A-Meta About the project itself labels Mar 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Cross-Cutting Impacts the entire engine C-Docs An addition or correction to our documentation C-Performance A change motivated by improving speed, memory usage or compile times
Projects
None yet
Development

No branches or pull requests

5 participants