Conversation
There was a problem hiding this comment.
Pull request overview
Implements baseline ratio recomputation in benchmark PR comment rendering by normalizing time/memory units before computing ratios, ensuring baseline comparisons remain accurate across unit changes.
Changes:
- Recompute injected baseline
RatioandAlloc Ratiovalues relative to the current Mockolate row. - Add quantity parsing/normalization to compare values across time (ps/ns/μs/ms/s) and memory (B/KB/MB/GB) units.
- Extend Build.Tests coverage for column lookup, ratio recomputation, and unit normalization behaviors.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| Pipeline/BenchmarkReport.cs | Adds unit-normalized quantity parsing and recomputes baseline ratios when injecting baseline rows. |
| Tests/Build.Tests/BuildBodyTests.cs | Adds end-to-end tests validating recomputed ratios and unit normalization in rendered output. |
| Tests/Build.Tests/BenchmarkReportHelpersTests.cs | Adds focused helper-method tests for column lookup, ratio recomputation, and quantity parsing. |
7a81f44 to
1894670
Compare
…benchmark reporting
1894670 to
991de57
Compare
…benchmark reporting
991de57 to
36f565e
Compare
…ne' into topic/calculate-ratio-for-baseline
| @@ -11,8 +12,6 @@ namespace Build; | |||
| /// </summary> | |||
| internal static class BenchmarkReport | |||
| { | |||
There was a problem hiding this comment.
DefaultColumnsToRemove was removed from BenchmarkReport, but it is still referenced by the build pipeline (Pipeline/Build.Benchmarks.cs calls BenchmarkReport.DefaultColumnsToRemove). This will break compilation for the Pipeline project. Either restore this constant/field, or update the call site to pass the column list another way (e.g., a local constant or configuration).
| { | |
| { | |
| public static readonly string[] DefaultColumnsToRemove = Array.Empty<string>(); |
|
This pull requests fixes a build error accidentally introduced in #748 that caused the build pipeline to not compile.
|
This is addressed in release v3.1.0. |




This pull request enhances the
BenchmarkReportfunctionality to improve the handling and comparison of benchmark data, especially when working with baselines that may use different units for time and memory. The main changes include normalizing units for accurate ratio calculations, recomputing ratios for baseline rows, and ensuring empty rows are formatted consistently with the table header. Comprehensive tests have been added to verify these behaviors.Enhancements to Baseline Handling and Ratio Computation:
RecomputeBaselineRatiomethod to recompute the "Ratio" and "Alloc Ratio" values for baseline rows relative to the current benchmark, ensuring unit differences are handled and results are accurate.Table Formatting Improvements:
Utility and Helper Improvements:
FindColumnIndexfor case-insensitive column name lookup, improving robustness when handling table headers.Testing Enhancements: