1.4 KiB
1.4 KiB
Analyze Bottlenecks
Analyze performance bottlenecks in the following area: $ARGUMENTS
Analysis Steps:
- CPU Profiling: Identify CPU-intensive functions and hot paths
- Memory Profiling: Check for memory leaks and high allocation patterns
- Goroutine Analysis: Look for goroutine leaks and blocking operations
- I/O Performance: Analyze network and disk I/O patterns
- Concurrency Issues: Check for race conditions and lock contention
Profiling Commands:
# CPU profile with detailed analysis
go tool pprof -top -cum http://localhost:9090/debug/pprof/profile?seconds=60
# Memory profile with allocation details
go tool pprof -alloc_space http://localhost:9090/debug/pprof/heap
# Goroutine blocking profile
go tool pprof http://localhost:9090/debug/pprof/block
# Mutex contention profile
go tool pprof http://localhost:9090/debug/pprof/mutex
Analysis Focus Areas:
- Worker pool efficiency in
pkg/market/pipeline.go - Event parsing performance in
pkg/events/ - Uniswap math calculations in
pkg/uniswap/ - Memory usage in large transaction processing
- Rate limiting effectiveness in
internal/ratelimit/
Output Requirements:
- Detailed bottleneck analysis with percentages
- Flame graphs and performance visualizations
- Root cause identification for top bottlenecks
- Optimization recommendations with expected impact
- Priority ranking of issues