bevy-performance
Installation
SKILL.md
Bevy performance
When to use
Load this when a system is slow or assets stay in memory. Pair it with bevy-debugging-profiling for the counters. Sources: the Quick Start ECS page, bevy::diagnostic, and the bevy::asset index (docs.rs latest, 0.20.0).
ECS shape
- Systems: the ECS page says systems run in parallel when they can.
.chain()forces order and removes that parallelism for the chained set. Put.chain()only on the systems that must see each other's writes. - Fixed step: movement and other gameplay that should not follow the render frame belong on
Fixed/FixedMain(bevy::time), not on everyUpdate. - Measures:
FrameTimeDiagnosticsPluginrecords frame time, fps, and frame count.EntityCountDiagnosticsPluginrecords entity count.SystemInformationDiagnosticsPluginrecords processcpu_usageandmem_usage.LogDiagnosticsPluginprints them. No target milliseconds are stated on those pages. - Memory:
Handleis reference counted. A strong handle kept in a long-livedResourcekeeps the asset. The last strong drop removes it fromAssets<T>.Assets::adddoes not deduplicate procedural assets.AssetServer::loadreuses a handle while one remains. - Schedule: diagnostics plugins are added on the
AppafterDefaultPlugins. Do not invent a budget resource.