-
Notifications
You must be signed in to change notification settings - Fork 34
Closed
Labels
Description
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
-
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) { ... }
-
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)) }() ... }
-
Add memory profiling:
- Track allocation counts for large workflows
- Identify memory hotspots
- Add tests verifying memory stays within bounds
-
Document benchmarking in
DEVGUIDE.md:make benchmark # Run performance benchmarks make test-benchmark # Include in test suite
-
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
Copilot