Repository navigation
Conversation
divan and codspeed_uri!, which codspeed_bench! uses, built the file part of the URI from file!(), which is relative to the Cargo workspace root. criterion and bencher use a path relative to the git root. When the Cargo workspace sits in a subdirectory of the repository, divan gave `benches/x.rs` where criterion gave `rust/benches/x.rs` for the same file. get_git_relative_path now computes the file part for every integration. It canonicalizes the path, then strips the git root. When canonicalization fails (e.g. the file no longer exists), it removes the `.` and `..` segments without touching the file system, then strips the git root. Before, criterion and bencher kept the path as is in this case, so the URI could hold an absolute path and `..` segments. divan and codspeed_uri! call it through get_git_relative_file_path, which joins file!() to CODSPEED_CARGO_WORKSPACE_ROOT, like caller_file_path does for criterion. The unreleased normalize_file_path becomes the private normalize_path fallback. BREAKING CHANGE: divan and codspeed_bench! benchmarks of a Cargo workspace below the git root get a new URI, so their history restarts. Closes COD-4451 Co-Authored-By: Claude <noreply@anthropic.com>
Merging this PR will regress 1 benchmark4 warnings, 1 note
Warning Please fix the performance issues or acknowledge them on CodSpeed. Performance Changes
Tip Investigate this regression by commenting Comparing |
divan and
codspeed_uri!(used bycodspeed_bench!) build the file part of the benchmark URI fromfile!(), which is relative to the Cargo workspace root. criterion and bencher use a path relative to the git root. When the Cargo workspace sits in a subdirectory of the repository, divan givesbenches/x.rswhere criterion givesrust/benches/x.rsfor the same file.get_git_relative_pathnow computes the file part for every integration:.and..segments without touching the file system, then strips the git root. Before, criterion and bencher kept the path as is in this case, so the URI could hold an absolute path and..segments.divan (compat and fork) and
codspeed_uri!call it throughget_git_relative_file_path(file!()), which joinsfile!()toCODSPEED_CARGO_WORKSPACE_ROOT, likecaller_file_pathalready does for criterion.normalize_file_pathfrom #212 was never released; it becomes the privatenormalize_pathfallback.Breaking change
divan and
codspeed_bench!benchmarks of a Cargo workspace below the git root get a new URI, so their history restarts. This should ship in a major release, after benchmark rename support (COD-460) lands.Closes COD-4451