Skip to content

PerfDiff: Fix resource management and disposal patterns #612

@coderabbitai

Description

@coderabbitai

Description

Resource management issues identified where objects implementing IDisposable are not properly disposed.

Issues Identified from PR #565

Disposal Issues

  • Program.cs:49: cancellationTokenSource not disposed when no longer needed
  • Risk of resource leaks in command-line application

API Design Issues

  • Multiple out parameter warnings in regression strategies
  • While legitimate for returning detailed results, consider if alternative patterns might be cleaner

Affected Files

  • src/tools/PerfDiff/Program.cs
  • src/tools/PerfDiff/BDN/Regression/IBenchmarkRegressionStrategy.cs
  • src/tools/PerfDiff/BDN/Regression/PercentageRegressionStrategy.cs
  • src/tools/PerfDiff/BDN/Regression/PercentileRegressionStrategy.cs
  • src/tools/PerfDiff/BDN/Regression/RegressionStrategyHelper.cs

Suggested Solutions

  • Implement proper using statements or try-finally blocks for disposable resources
  • Consider returning result objects instead of out parameters where appropriate
  • Add resource management unit tests

Reference

Metadata

Metadata

Assignees

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions