Performance Analysis Skill
Comprehensive performance analysis suite for identifying bottlenecks, profiling swarm operations, generating detailed reports, and providing actionable optimization recommendations.
Overview
This skill consolidates all performance analysis capabilities:
- Bottleneck Detection: Identify performance bottlenecks across communication, processing, memory, and network
- Performance Profiling: Real-time monitoring and historical analysis of swarm operations
- Report Generation: Create comprehensive performance reports in multiple formats
- Optimization Recommendations: AI-powered suggestions for improving performance
Quick Start
Basic Bottleneck Detection
Generate Performance Report
Analyze and Auto-Fix
Core Capabilities
1. Bottleneck Detection
Command Syntax
Options
--swarm-id, -s <id>- Analyze specific swarm (default: current)--time-range, -t <range>- Analysis period: 1h, 24h, 7d, all (default: 1h)--threshold <percent>- Bottleneck threshold percentage (default: 20)--export, -e <file>- Export analysis to file--fix- Apply automatic optimizations
Usage Examples
Metrics Analyzed
Communication Bottlenecks:
- Message queue delays
- Agent response times
- Coordination overhead
- Memory access patterns
- Inter-agent communication latency
Processing Bottlenecks:
- Task completion times
- Agent utilization rates
- Parallel execution efficiency
- Resource contention
- CPU$memory usage patterns
Memory Bottlenecks:
- Cache hit rates
- Memory access patterns
- Storage I/O performance
- Neural pattern loading times
- Memory allocation efficiency
Network Bottlenecks:
- API call latency
- MCP communication delays
- External service timeouts
- Concurrent request limits
- Network throughput issues
Output Format
2. Performance Profiling
Real-time Detection
Automatic analysis during task execution:
- Execution time vs. complexity
- Agent utilization rates
- Resource constraints
- Operation patterns
Common Bottleneck Patterns
Time Bottlenecks:
- Tasks taking > 5 minutes
- Sequential operations that could parallelize
- Redundant file operations
- Inefficient algorithm implementations
Coordination Bottlenecks:
- Single agent for complex tasks
- Unbalanced agent workloads
- Poor topology selection
- Excessive synchronization points
Resource Bottlenecks:
- High operation count (> 100)
- Memory constraints
- I/O limitations
- Thread pool saturation
MCP Integration
Result Format:
3. Report Generation
Command Syntax
Options
--format <type>- Report format: json, html, markdown (default: markdown)--include-metrics- Include detailed metrics and charts--compare <id>- Compare with previous swarm--time-range <range>- Analysis period: 1h, 24h, 7d, 30d, all--output <file>- Output file path--sections <list>- Comma-separated sections to include
Report Sections
-
Executive Summary
- Overall performance score
- Key metrics overview
- Critical findings
-
Swarm Overview
- Topology configuration
- Agent distribution
- Task statistics
-
Performance Metrics
- Execution times
- Throughput analysis
- Resource utilization
- Latency breakdown
-
Bottleneck Analysis
- Identified bottlenecks
- Impact assessment
- Optimization priorities
-
Comparative Analysis (when --compare used)
- Performance trends
- Improvement metrics
- Regression detection
-
Recommendations
- Prioritized action items
- Expected improvements
- Implementation guidance
Usage Examples
Sample Markdown Report
4. Optimization Recommendations
Automatic Fixes
When using --fix, the following optimizations may be applied:
1. Topology Optimization
- Switch to more efficient topology (mesh → hierarchical)
- Adjust communication patterns
- Reduce coordination overhead
- Optimize message routing
2. Caching Enhancement
- Enable memory caching
- Optimize cache strategies
- Preload common patterns
- Implement cache warming
3. Concurrency Tuning
- Adjust agent counts
- Optimize parallel execution
- Balance workload distribution
- Implement load balancing
4. Priority Adjustment
- Reorder task queues
- Prioritize critical paths
- Reduce wait times
- Implement fair scheduling
5. Resource Optimization
- Optimize memory usage
- Reduce I/O operations
- Batch API calls
- Implement connection pooling
Performance Impact
Typical improvements after bottleneck resolution:
- Communication: 30-50% faster message delivery
- Processing: 20-40% reduced task completion time
- Memory: 40-60% fewer cache misses
- Network: 25-45% reduced API latency
- Overall: 25-45% total performance improvement
Advanced Usage
Continuous Monitoring
CI/CD Integration
Custom Analysis Scripts
Best Practices
1. Regular Analysis
- Run bottleneck detection after major changes
- Generate weekly performance reports
- Monitor trends over time
- Set up automated alerts
2. Threshold Tuning
- Start with default threshold (20%)
- Lower for production systems (10-15%)
- Higher for development (25-30%)
- Adjust based on requirements
3. Fix Strategy
- Always review before applying --fix
- Test fixes in development first
- Apply fixes incrementally
- Monitor impact after changes
4. Report Integration
- Include in documentation
- Share with team regularly
- Track improvements over time
- Use for capacity planning
5. Continuous Optimization
- Learn from each analysis
- Build performance budgets
- Establish baselines
- Set improvement goals
Troubleshooting
Common Issues
High Memory Usage
Slow Task Execution
Poor Cache Performance
Integration with Other Skills
- swarm-orchestration: Use performance data to optimize topology
- memory-management: Improve cache strategies based on analysis
- task-coordination: Adjust scheduling based on bottlenecks
- neural-training: Train patterns from performance data
Related Commands
npx claude-flow swarm monitor- Real-time monitoringnpx claude-flow token usage- Token optimization analysisnpx claude-flow cache manage- Cache optimizationnpx claude-flow agent metrics- Agent performance metricsnpx claude-flow task status- Task execution analysis
See Also
- Bottleneck Detection Guide [blocked]
- Performance Report Guide [blocked]
- Performance Bottlenecks Overview [blocked]
- Swarm Monitoring Documentation [blocked]
- Memory Management Documentation [blocked]
Version: 1.0.0 Last Updated: 2025-10-19 Maintainer: Claude Flow Team


