Skip to content

[plan] Add compilation performance monitoring and benchmarks #8313

@github-actions

Description

@github-actions

Objective

Add systematic performance monitoring for workflow compilation including benchmark tests, timing metrics, and memory profiling to maintain fast compilation as complexity grows.

Context

Currently no systematic tracking exists for:

  • Compilation time for different workflow types
  • Memory usage patterns
  • Performance bottlenecks
  • Regression detection

Approach

  1. Create comprehensive benchmark tests:

    // pkg/workflow/compiler_performance_benchmark_test.go
    func BenchmarkCompileSimpleWorkflow(b *testing.B) { ... }
    func BenchmarkCompileComplexWorkflow(b *testing.B) { ... }
    func BenchmarkCompileMCPWorkflow(b *testing.B) { ... }
  2. Add timing metrics in compiler:

    import "github.com/githubnext/gh-aw/pkg/logger"
    
    var log = logger.New("workflow:compiler")
    
    func (c *Compiler) Compile(...) error {
        start := time.Now()
        defer func() {
            log.Printf("Compilation completed in %v", time.Since(start))
        }()
        ...
    }
  3. Add memory profiling:

    • Track allocation counts for large workflows
    • Identify memory hotspots
    • Add tests verifying memory stays within bounds
  4. Document benchmarking in DEVGUIDE.md:

    make benchmark           # Run performance benchmarks
    make test-benchmark      # Include in test suite
  5. Set baseline targets and add regression tests

Files to Create/Modify

  • Create: pkg/workflow/compiler_performance_benchmark_test.go
  • Modify: pkg/workflow/compiler.go (add timing logs)
  • Modify: Makefile (add benchmark target)
  • Modify: DEVGUIDE.md (document benchmarking)

Acceptance Criteria

  • Benchmark tests exist for simple, complex, and MCP-heavy workflows
  • Compilation time is logged in debug mode
  • Memory usage metrics are collected for large workflows
  • Performance regression tests prevent slowdowns
  • Documentation explains how to run and interpret benchmarks
  • Baseline performance targets are established (e.g., <5s for typical workflows)
    Related to [plan] Improve workflow compilation accuracy and safety #8308

AI generated by Plan Command for discussion #8292

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions