Debug build size is excessive
- Dominant language
- Rust
- Stars
- 48.2k
- Forks
- 4.8k
- Avg merge
- 3d 16h
- Merged PRs (30d)
- 171
Description
## Bevy version
`0.17.3`
## Relevant system information
Please include:
* `cargo 1.90.0 (840b83a10 2025-07-30)`
* arch linux thing
## What's performing poorly?
Debug build size is quite excessive at 961mb.
```sh
> cargo new bevy_size_test
> cd bevy_size_test
> cargo add bevy
> echo "fn main() { bevy::app::App::new().add_plugins(bevy::DefaultPlugins).run(); }" > src/main.rs
> cargo b
> cargo b --release
> ls target/*/bevy_size_test
.rwxr-xr-x 1.0G choc 26 Nov 00:51 target/debug/bevy_size_test
.rwxr-xr-x 130M choc 26 Nov 00:49 target/release/bevy_size_test
```
**line-tables-only**
```toml
[profile.dev]
debug = "line-tables-only"
```
```sh
> ls target/*/bevy_size_test
.rwxr-xr-x 402M choc 26 Nov 00:56 target/debug/bevy_size_test
```
**strip**
```toml
[profile.dev]
strip = true
```
```sh
> ls target/*/bevy_size_test
.rwxr-xr-x 158M choc 26 Nov 00:54 target/debug/bevy_size_test
```
These options can help, but the default dev build profile should be better since it is what users will get out of the box with bevy before setting any specific flags. This is especially likely to affect potential users who may be coming from other game engines and who are new to rust.
Based on the numbers above, of the 961mb build, 803mb is debug information related. Or put another way 84% of the binary is debug info.
Even accounting for complete removal of debug info, the stripped build should ideally be smaller than it is.
Contributor guide
Research direction
Start by reproducing the issue with the minimal Bevy application and the shown `cargo b` and `cargo b --release` commands. Compare the default debug profile with the reported `line-tables-only` and `strip` settings; done means reducing the default debug binary size without making the development build impractical.
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
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100