-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Rendering makes up 75% of compile time #23642
Copy link
Copy link
Open
Labels
A-Build-SystemRelated to build systems or continuous integrationRelated to build systems or continuous integrationA-RenderingDrawing game state to the screenDrawing game state to the screenC-PerformanceA change motivated by improving speed, memory usage or compile timesA change motivated by improving speed, memory usage or compile times
Metadata
Metadata
Assignees
Labels
A-Build-SystemRelated to build systems or continuous integrationRelated to build systems or continuous integrationA-RenderingDrawing game state to the screenDrawing game state to the screenC-PerformanceA change motivated by improving speed, memory usage or compile timesA change motivated by improving speed, memory usage or compile times
Type
Projects
Status
Needs SME Triage
Background: Discussion on Discord with @ChristopherBiscardi and @Elabajaba.
Bevy version
Tested on main, commit
45e454a83bffd7a496621ba77bc3429fa472733d.System information
Reproduction
Run
cargo clean && cargo build --timings --example 3d_scene, then inspect the generated timings file.Mine is here for reference: https://gist.github.com/TimJentzsch/3fcc84bc8dfa261f7775ade2b2cb274b
Results
The flamegraph shows that a large part of the compilation is spent on a waterfall of rendering crates that is largely compiled sequentially.
The critical path here is:
bevy_render: 25.15sbevy_core_pipeline: 17.04sbevy_pbr: 43.61sbevy_gizmos_render: 5.4sThese rendering crates sum up to 91.2s, which is 76% of the total compile time.
About half of that is
bevy_pbr.Comparison with Bevy ~0.12
The original discussion was about comparing compile times with an old Bevy version, commit
22e39c4(v0.12) that @IceSentry benchmarked back in 2024.On https://github.com/TimJentzsch/bevy/tree/old-bevy is a small patch of this commit (figured out by @Elabajaba) that still compiles today.
Timings on my system:
Full timings: https://gist.github.com/TimJentzsch/ae10132cc0b6b20f9b74245008183c50
Notably, the compile time is only ~17% of what it is today.
bevy_pbrtakes over 17 times as long now.Of course, it's not a fair comparison, Bevy's feature set has grown massively since then, especially with regards to rendering. But still interesting to see the differences.