Repository navigation
perf(spirv-builder): resolve the target dir once per SpirvWatcher - #695
Closed
sorinirimies wants to merge 1 commit into
Closed
sorinirimies wants to merge 1 commit into
sorinirimies wants to merge 1 commit into
Conversation
A relative `target_dir_path` (the default) is resolved with `cargo metadata` on every `invoke_rustc`, i.e. on every rebuild of a watched crate (~230ms for sky-shader). `SpirvWatcher` now pins it to the absolute path before the first build; failures are retried on the next build and reported by `invoke_rustc` as before. Extracts `SpirvBuilder::resolve_target_dir` and tests it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
With the default relative
target_dir_path("spirv-builder"),invoke_rustcrunscargo metadatato find the target dir on every call — so every rebuild of aSpirvWatcher.SpirvBuilder::resolve_target_diris extracted frominvoke_rustcunchanged.Evidence
cargo metadatacost saved per rebuild (sky-shader, warm):New
tests::target_dir:cargo test -p spirv-builder --features watch,clap: all pass. Clippy-D warningsclean.Merge Danger
Door: two-way
Blast Radius: small — watcher only. If a user changes the cargo target dir (e.g.
.cargo/config.tomlbuild.target-dir) while watching, the watcher keeps the old one until restarted.