Skip to content
This repository was archived by the owner on Oct 31, 2025. It is now read-only.

spirv-builder: force a single CGU (codegen-unit).#1035

Merged
eddyb merged 2 commits intoEmbarkStudios:mainfrom
LykenSol:sole-cgu
Apr 17, 2023
Merged

spirv-builder: force a single CGU (codegen-unit).#1035
eddyb merged 2 commits intoEmbarkStudios:mainfrom
LykenSol:sole-cgu

Conversation

@eddyb
Copy link
Contributor

@eddyb eddyb commented Apr 15, 2023

The main reason rustc has a concept of "codegen units" is to allow running LLVM optimizations in parallel.
We have no such parallelism right now, so all CGUs do for us is cause wasteful duplication of work.
(this came up in other work where it caused a massive explosion of debuginfo)

I ran this to get the data in the table below (both before and after the change):

rm -rf target/spirv-builder/
cargo run -p example-runner-wgpu --release --no-default-features --features use-installed-tools -- -s Mouse
dust -csbrn10 target/spirv-builder/spirv-unknown-vulkan1.1
Before this PR (many CGUs)After this PR (1 CGU)
128M └─┬ spirv-unknown-vulkan1.1
128M   └─┬ release
117M     ├─┬ deps
 44M     │ ├── libcore-f3590347654738e9.rlib
 38M     │ ├── libcore-f3590347654738e9.rmeta
6.2M     │ ├── libglam-07642c7dac08746c.rlib
5.9M     │ └── libglam-07642c7dac08746c.rmeta
 10M     └─┬ incremental
7.9M       └─┬ spirv_std-3rzoyk5mydowb
7.9M         └─┬ s-gk2fjiu00l-scpc61-tw2x301r7v8h
5.5M           └── dep-graph.bin
123M └─┬ spirv-unknown-vulkan1.1
123M   └─┬ release
112M     ├─┬ deps
 43M     │ ├── libcore-b338bddeac41658a.rlib
 38M     │ ├── libcore-b338bddeac41658a.rmeta
6.2M     │ ├── libglam-3dba180d0288b28f.rlib
5.9M     │ └── libglam-3dba180d0288b28f.rmeta
 10M     └─┬ incremental
7.8M       └─┬ spirv_std-3dftucm2yp1ij
7.8M         └─┬ s-gk2fozx3vf-108z0x5-3fc8kftdgx7kt
5.5M           └── dep-graph.bin

@eddyb eddyb marked this pull request as ready for review April 15, 2023 16:03
@eddyb eddyb requested a review from oisyn as a code owner April 15, 2023 16:03
@eddyb eddyb enabled auto-merge (rebase) April 15, 2023 17:28
@LegNeato

This comment was marked as off-topic.

@eddyb

This comment was marked as off-topic.

@eddyb eddyb merged commit b560a21 into EmbarkStudios:main Apr 17, 2023
@eddyb eddyb deleted the sole-cgu branch April 17, 2023 11:24
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants