Summary
The staging overlay in src/staging.rs mirrors every file and directory under the workspace root (excluding target/ and .git/). For large workspaces with many crates, thousands of files get symlinked even though only a handful are being compiled by the current wrapper invocation.
Impact
This is O(workspace_size) per crate compilation. For small-to-medium projects, overhead is negligible. For large monorepos with hundreds of crates, the symlink creation could measurably slow builds.
Suggested optimization
Mirror only the subtree containing the crate being compiled, not the entire workspace. The wrapper knows the crate's source directory from the config, so it could scope the overlay to just that subtree plus any directories referenced by include! / include_str! / include_bytes!.
Summary
The staging overlay in
src/staging.rsmirrors every file and directory under the workspace root (excludingtarget/and.git/). For large workspaces with many crates, thousands of files get symlinked even though only a handful are being compiled by the current wrapper invocation.Impact
This is O(workspace_size) per crate compilation. For small-to-medium projects, overhead is negligible. For large monorepos with hundreds of crates, the symlink creation could measurably slow builds.
Suggested optimization
Mirror only the subtree containing the crate being compiled, not the entire workspace. The wrapper knows the crate's source directory from the config, so it could scope the overlay to just that subtree plus any directories referenced by
include!/include_str!/include_bytes!.