Add automated performance benchmarks with BenchmarkDotNet#1188
Add automated performance benchmarks with BenchmarkDotNet#1188adamhathcock merged 15 commits intomasterfrom
Conversation
Co-authored-by: adamhathcock <527620+adamhathcock@users.noreply.github.com>
…performance benchmarks Co-authored-by: adamhathcock <527620+adamhathcock@users.noreply.github.com>
Co-authored-by: adamhathcock <527620+adamhathcock@users.noreply.github.com>
Co-authored-by: adamhathcock <527620+adamhathcock@users.noreply.github.com>
…ks' into copilot/add-performance-benchmarks # Conflicts: # tests/SharpCompress.Performance/Program.cs
|
@copilot change the bash scripts in the github action to be c# in the build folder to do display and comparsion |
…comparison Co-authored-by: adamhathcock <527620+adamhathcock@users.noreply.github.com>
Done! Replaced the bash scripts with C# build targets in commit 2fa8196. The GitHub Actions workflow now calls:
Both targets work cross-platform and integrate with GITHUB_STEP_SUMMARY for displaying results in the workflow summary. |
|
@copilot add a function to the build.csproj to generate baseline benchmarks that will be used for comparsion in CI also, add the performance project the ability to use JetbrainsProfiler to run locally to get Cpu and Memory profiles |
Co-authored-by: adamhathcock <527620+adamhathcock@users.noreply.github.com>
Done in commit bbc664d! Generate Baseline Build Target: dotnet run --project build/build.csproj -- generate-baselineThis automates: building the performance project, running all benchmarks, combining markdown reports into JetBrains Profiler Support: # CPU profiling
dotnet run --project tests/SharpCompress.Performance/SharpCompress.Performance.csproj -c Release -- --profile --type cpu --output ./snapshots
# Memory profiling
dotnet run --project tests/SharpCompress.Performance/SharpCompress.Performance.csproj -c Release -- --profile --type memory --output ./snapshotsThe performance project now detects |
|
@copilot no comparision happens with the results in CompareBenchmarkResults |
Co-authored-by: adamhathcock <527620+adamhathcock@users.noreply.github.com>
Fixed in commit 118fbbe! The
Example output shows side-by-side comparison with change percentages, making it easy to spot performance issues in CI. |
Implementation Plan for BenchmarkDotNet Performance Benchmarks
✅ All tasks completed!
Summary
This PR implements comprehensive performance benchmarks using BenchmarkDotNet for all major SharpCompress formats. The benchmarks:
✅ Run automatically in CI on push/PR to master and release branches
✅ Compare against baseline results stored in the repo with actual diff analysis
✅ Test CPU and memory usage for all supported archive formats
✅ Use minimal iterations for fast CI execution
✅ Display results in GitHub Actions summary using C# build targets
✅ Include detailed documentation
Latest update:
The
compare-benchmark-resultstarget now performs actual comparison:Comparison Output Example
See
tests/SharpCompress.Performance/README.mdfor complete details.Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.