Issue automatically imported from old repo: EmbarkStudios/rust-gpu#858
Originally creatd by repi on 2022-04-10T11:01:16Z
We should look into improve our clean build times of when building spriv-builder & rustc_codegen_spirv as that is the main scenario in CI and also useful for users if our crates rebuild fast.
Right now it looks like we have a couple of quite unfortunate serial dependencies that significantly increases the wall time. Here is the current results with cargo build --release -p spirv-builder -Z timings on my AMD 5950x (32 vCPU):

Potential optimizations
If we do get rid of serde and manage to make sure rustc_codegen_spirv doesn't have to wait for the spirv-tools-sys build, we could get get a 15+ second wall time improvement here as rustc_codegen_spirv could start as soon as frontend section of rspirv has been built:
- 
Issue automatically imported from old repo: EmbarkStudios/rust-gpu#858
Originally creatd by repi on 2022-04-10T11:01:16Z
We should look into improve our clean build times of when building
spriv-builder&rustc_codegen_spirvas that is the main scenario in CI and also useful for users if our crates rebuild fast.Right now it looks like we have a couple of quite unfortunate serial dependencies that significantly increases the wall time. Here is the current results with
cargo build --release -p spirv-builder -Z timingson my AMD 5950x (32 vCPU):Potential optimizations
spirv-builderbe the one depending onspirv-toolsinstead ofrustc_codegen_spirv?serde, quite crazy it takes 20 seconds to compileModuleResultoutput and then the internal decorations that is using more complex serde implementation (CustomDecoration).serde+serde_jsonis taking such a crazy long time to build here though, can't see any other crates enabling tons of types that serde derive macros are used on or similarModuleResultwould be trivial to replace serde withnanoserde, could work forCustomDecorationalso?sanitize-filenamedependency that compiles and usesregexcrate for super trivial thingsrspirvitself somehow?rspirvrepo as far as I could seeDetermine whyreport.rustc_codegen_spirvis not split in frontend/codegen sections in the profilespriv-builderitself to start building earlier and before the codegen ofrustc_codegen_spirvis done.dylibIf we do get rid of serde and manage to make sure
rustc_codegen_spirvdoesn't have to wait for thespirv-tools-sysbuild, we could get get a 15+ second wall time improvement here asrustc_codegen_spirvcould start as soon as frontend section ofrspirvhas been built:-