bevyengine / bevyengine/bevy

Rendering makes up 75% of compile time

Open
#23,642 3 comments 0 reactions 0 assignees View on GitHub
A-Build-System A-Rendering C-Performance
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 16h
Merged PRs (30d)
171

Description

Background: [Discussion on Discord](https://discord.com/channels/691052431525675048/1489167876085776444/1489179712189235240) with @ChristopherBiscardi and @Elabajaba.

# Bevy version

Tested on main, commit `45e454a83bffd7a496621ba77bc3429fa472733d`.

# System information

- Linux (Pop!_OS), Ryzen 9 9950x3d CPU
- cargo 1.96.0-nightly (888f67534 2026-03-30)

# 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

Image

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:

1. `bevy_render`: 25.15s
2. `bevy_core_pipeline`: 17.04s
3. `bevy_pbr`: **43.61s**
4. `bevy_gizmos_render`: 5.4s

These 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](https://discord.com/channels/691052431525675048/1245430414533722265/1245430963547148389).
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:

Image

Full timings: https://gist.github.com/TimJentzsch/ae10132cc0b6b20f9b74245008183c50

Notably, the compile time is only ~17% of what it is today.
`bevy_pbr` takes 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.

Contributor guide

Open the contributing guide

Research direction

Reproduce the report with `cargo clean && cargo build --timings --example 3d_scene`, then inspect the generated timings and compare the rendering crates named in the issue: `bevy_render`, `bevy_core_pipeline`, `bevy_pbr`, and `bevy_gizmos_render`. Use the referenced timings and the v0.12 comparison as baselines; done means identifying and addressing the cause of the rendering compilation waterfall or documenting a concrete, measurable improvement.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
build-system, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.