Daily Perf Improver - Fix Benchmark Infrastructure for Cross-Platform Testing #1420
+7
−4
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.
Daily Perf Improver - Benchmark Infrastructure Fix
Summary
Fixed the existing benchmark infrastructure to enable cross-platform testing and establish a baseline for future performance measurements. This addresses Priority #1 from the performance research plan: Establish measurement baseline.
Goal and Rationale
Performance target: Enable reliable, reproducible benchmark execution across all platforms (Linux, macOS, Windows) to support systematic performance optimization work.
Why it matters: The existing benchmark had a hardcoded Windows file path that prevented execution in CI environments and on other platforms. Without working benchmarks, we cannot:
Changes Made
1. Cross-Platform File Content Generation
Before:
After:
Benefit: Benchmarks now run on any platform without external file dependencies. Content is realistic F# code (1000 lines of let bindings).
2. Updated .NET Runtime Target
Before:
.NET 7(RuntimeMoniker.Net70)After:
.NET 8(RuntimeMoniker.Net80)Benefit: Matches the project's target framework (net8.0) as specified in
benchmarks/benchmarks.fsproj, ensuring consistent measurement environment.Approach
Impact Measurement
Build Validation
✅ Build Success: Benchmarks compile successfully in Release mode
Benchmark Availability
The existing
SourceText_LineChanges_Benchmarksbenchmark can now be executed with:Parameterized test cases: N ∈ {1, 15, 50, 100, 1000} iterations
Memory tracking: Enabled via
[<MemoryDiagnoser>]Trade-offs
✅ Pros:
Mitigation: The benchmark tests
SourceTextline manipulation, not F# parsing, so synthetic F# code is appropriate. Future benchmarks can add varied file sizes.Validation
✅ Build Tests
✅ Code Review
Future Work
This infrastructure fix enables:
Reproducibility
Running the Benchmarks
Expected Behavior
BenchmarkDotNet.Artifacts/results/Related
.github/copilot/instructions/profiling-measurement.md.github/workflows/daily-perf-improver.yml🤖 Generated by Daily Perf Improver
Transferred from: githubnext/FsAutoComplete#3
Original Author: @github-actions[bot]