Skip to content

[Feature]: Add a --only-regressions flag #29

@KaykCaputo

Description

@KaykCaputo

Summary

Add a --only-regressions flag to filter diff output and display only functions whose performance has worsened between runs.

Problem

Current diff output includes both regressions and improvements, which introduces noise when the primary goal is to identify performance degradations. In real workflows—especially in CI or debugging regressions—developers typically care only about what got slower, not what improved.

Proposed Solution

Introduce a CLI flag:

oracletrace main.py --json new.json --compare base.json --only-regressions

Behavior:

  • Filter out any functions where:
    • execution time decreased
    • no significant change occurred
  • Only include functions where:
    • new_time > base_time
  • Maintain existing sorting and formatting logic
  • Ensure compatibility with other flags (e.g., --top, --sort)

Use Case

  • Quickly identify performance regressions after a code change
  • Reduce noise during manual analysis
  • Integrate into CI pipelines where only regressions should be evaluated or surfaced
  • Combine with --fail-on-regression for automated checks

Example (optional)

oracletrace main.py --json new.json --compare base.json --only-regressions
▲ foo()  +120ms (+30%)
▲ bar()  +45ms (+12%)

Total regressions: 2

Alternatives Considered

  • Adding a filter threshold (e.g., --min-delta)
    → Useful but does not replace the need to isolate regressions

Additional Context

  • Can be extended in the future with thresholds (e.g., only regressions above X%)
  • Minimal implementation: simple filter step before rendering output

Checklist

  • I searched existing issues before opening this request
  • I described the problem and why this feature is useful
  • I provided enough detail for implementation discussion

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions