Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2838 +/- ##
==========================================
- Coverage 73.71% 72.54% -1.17%
==========================================
Files 72 72
Lines 37932 39632 +1700
==========================================
+ Hits 27963 28753 +790
- Misses 9969 10879 +910 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
| * `SCCACHE_ALLOW_CORE_DUMPS` to enable core dumps by the server | ||
| * `SCCACHE_CONF` configuration file path | ||
| * `SCCACHE_BASEDIRS` base directory (or directories) to strip from paths for cache key computation. This is similar to ccache's `CCACHE_BASEDIR` and enables cache hits across different absolute paths when compiling the same source code. Multiple directories can be separated by `;` on Windows hosts and by `:` on any other operating system. When multiple directories are specified, the longest matching prefix is used. Path matching is **case-insensitive** on Windows and **case-sensitive** on other operating systems. Environment variable takes precedence over file configuration. Only absolute paths are supported; relative paths will cause an error and prevent the server from start. | ||
| * `SCCACHE_BASEDIRS` base directory (or directories) to strip from paths for cache key computation. This is similar to ccache's `CCACHE_BASEDIR` and enables cache hits across different absolute paths when compiling the same source code. Multiple directories can be separated by `;` on Windows hosts and by `:` on any other operating system. When multiple directories are specified, the longest matching prefix is used. Path matching is **case-insensitive** on Windows and **case-sensitive** on other operating systems. For Rust, sccache normalizes matching absolute source arguments, the source side of `--remap-path-prefix`, Cargo path variables, tracked environment dependency values that are absolute paths, and the current working directory. Environment variable takes precedence over file configuration. Only absolute paths are supported; relative paths will cause an error and prevent the server from starting. This setting changes cache keys but does not rewrite paths embedded in artifacts; a Rust artifact can retain an absolute path from the compilation that populated the cache. |
There was a problem hiding this comment.
sorry but i just would like the benchmark change in this PR
| * Procedural macros that read files from the filesystem may not be cached properly. | ||
| * `rustc`'s incremental compilation needs to be disabled. See [The Cargo Book](https://doc.rust-lang.org/cargo/reference/profiles.html#incremental) | ||
| * Crates that invoke the system linker cannot be cached. Examples are `bin`, `dylib`, `cdylib`, and `proc-macro` crates. | ||
| * `SCCACHE_BASEDIRS` normalizes matching paths in cache-key inputs, but it does not rewrite paths embedded in artifacts. For example, a crate that uses `env!("CARGO_MANIFEST_DIR")` can retain the path from the compilation that populated a shared cache entry. |
5b48e27 to
c9b3c45
Compare
| bencher.bench(|| black_box(strip_basedirs(black_box(&output), black_box(&basedirs)))); | ||
| } | ||
|
|
||
| /// Most dependency paths fall outside the configured checkout roots. |
There was a problem hiding this comment.
the 0 case returns immediately in the helper, so it only measures the loop —-worth keeping?
|
|
||
| /// Most dependency paths fall outside the configured checkout roots. | ||
| #[divan::bench(args = [0, 1, 8, 32])] | ||
| fn strip_basedirs_from_arg_mostly_unmatched(bencher: Bencher, root_count: usize) { |
There was a problem hiding this comment.
all the inputs here are bare paths, but this helper is about compiler arguments — could you please bench -I/path, -ffile-prefix-map=/path=/x too? that's where pathname_positions does the work.
| .map(|i| format!("/workspaces/project/checkouts/worktree-{i:02}/").into_bytes()) | ||
| .collect(); | ||
| let paths: Vec<Vec<u8>> = (0..100) | ||
| .map(|i| { |
There was a problem hiding this comment.
why 7? please document or just use i / 10
Adds a benchmark for the existing
strip_basedirs_from_arghelper. Each iteration strips 100 path arguments with 0, 1, 8, or 32 configured roots; 90% of paths are outside those roots. Fixture assertions verify matching and unchanged outputs before timing.This PR changes only
benches/sccache_bench.rsand applies directly to current upstream. It no longer includes or depends on #2813. It measures the compiler-argument helper already in main, rather than the Rust-specific matcher proposed there.Formatting, clippy, the locked unit/integration suite, and all four benchmark cases pass on Apple silicon. CUDA cases skip locally. Developed with OpenAI Codex.