bevyengine / bevy

A refreshingly simple data-driven game engine built in Rust
https://bevyengine.org
Apache License 2.0
35.11k stars 3.45k forks source link

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

Open alice-i-cecile opened 2 years ago

alice-i-cecile commented 2 years ago

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.

Nilirad commented 2 years ago

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 commented 2 years ago

there is also https://github.com/bevyengine/bevy/issues/1885

SamPruden commented 2 years ago

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 commented 2 years ago

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 commented 1 year ago

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:

Hope it could help with PGO story for Bevy.