SOAP Performance Analyzer
The SOAP Performance Analyzer is SoapKit's professional performance monitoring and optimization tool. It provides real-time analysis of event frequency, listener counts, variable change rates, and automatic detection of performance bottlenecks in your SOAP architecture.
Overviewâ
The Performance Analyzer monitors your SOAP assets during Play Mode, collecting detailed metrics and providing actionable optimization recommendations. It's designed to help you maintain high-performance SOAP architectures even in complex, large-scale projects.
Access: Window > SoapKit > Performance Analyzer
Key Featuresâ
- ⥠Real-Time Monitoring - Live performance tracking during Play Mode
- đĨ Hotspot Detection - Automatic identification of performance bottlenecks
- đ Comprehensive Metrics - Event frequency, listener counts, memory usage
- đ¯ Smart Recommendations - AI-powered optimization suggestions
- đ Historical Analysis - Track performance trends over time
- đ¨ Alert System - Configurable thresholds and warnings
- đĄ Optimization Guide - Step-by-step improvement instructions
- đ Detailed Profiling - Per-asset performance breakdown
Core Analysis Featuresâ
Real-Time Performance Monitoringâ
The analyzer continuously tracks your SOAP assets during Play Mode:
Monitored Metrics:
đ¯ Event Performance:
âââ Raises per second (frequency analysis)
âââ Listener count impact
âââ Average raise duration
âââ Memory allocation patterns
đ Variable Performance:
âââ Change events per second
âââ Value change frequency
âââ Listener notification overhead
âââ Memory usage patterns
⥠System Performance:
âââ Total system overhead
âââ Update distribution
âââ Memory footprint
âââ GC impact analysis
Live Dashboard:
- System Status - Overall health indicator with color-coded status
- Active Monitoring - Real-time counters and metrics
- Performance Graphs - Visual trends and spike detection
- Resource Usage - Memory and CPU impact tracking
Performance Tabs Overviewâ
1. Overview Tabâ
System-wide performance summary and key metrics:
System Statistics:
đ Current Performance Status:
Total Events: 23 | Total Variables: 31
Active Listeners: 156 | Event Rate: 12.4/sec
System Health: đĸ Good (87/100)
Memory Usage: 2.1 MB | GC Impact: Low
đĨ Active Hotspots:
âĸ PlayerInputHandler: 47 events/sec (đ´ Critical)
âĸ UIUpdateManager: 23 variables/sec (đĄ Warning)
âĸ GameStateController: 15 listeners (âĒ Info)
⥠Performance Trends:
âĸ Event frequency increased 15% in last 5 minutes
âĸ Memory usage stable at 2.1MB
âĸ 3 new performance warnings detected
Health Score Calculation:
- Green (80-100) - Excellent performance, no issues
- Yellow (60-79) - Good performance, minor optimizations possible
- Orange (40-59) - Moderate issues, optimization recommended
- Red (0-39) - Critical issues, immediate attention required
2. Events Tabâ
Detailed analysis of all GameEvent performance:
Event Performance Metrics:
đĄ Event: "OnPlayerHealthChanged" (IntGameEvent)
âââ Total Raises: 847 (during session)
âââ Current Rate: 12.3 raises/sec
âââ Listeners: 8 active listeners
âââ Performance: đ´ HOTSPOT (high frequency)
âââ Memory: 0.3 MB allocated
âââ Recent Activity: [12.1s, 12.0s, 11.9s, 11.8s...]
âââ Recommendation: Consider batching health updates
đĄ Event: "OnGamePaused" (BoolGameEvent)
âââ Total Raises: 12 (during session)
âââ Current Rate: 0.02 raises/sec
âââ Listeners: 3 active listeners
âââ Performance: đĸ Optimal
âââ Memory: 0.1 MB allocated
Event Analysis Features:
- Frequency Tracking - Detailed raise timing and patterns
- Listener Impact - Performance cost per listener
- Memory Profiling - Allocation tracking and leak detection
- Optimization Suggestions - Specific recommendations per event
3. Variables Tabâ
Comprehensive variable performance monitoring:
Variable Performance Analysis:
đ Variable: "PlayerHealth" (IntVariable)
âââ Change Events: 234 (during session)
âââ Change Rate: 3.2 changes/sec
âââ Current Value: 85/100
âââ C# Event Listeners: 5
âââ GameEvent Listeners: 3 (via OnValueChangedEvent)
âââ Performance: đĄ Monitor (moderate frequency)
âââ Memory: 0.2 MB
âââ Value History: [85, 84, 83, 85, 86, 85...]
đ Variable: "GameScore" (IntVariable)
âââ Change Events: 45 (during session)
âââ Change Rate: 0.6 changes/sec
âââ Current Value: 12,450
âââ C# Event Listeners: 2
âââ GameEvent Listeners: 1
âââ Performance: đĸ Optimal
âââ Memory: 0.1 MB
Variable-Specific Metrics:
- Change Frequency - How often values are modified
- Listener Distribution - C# events vs GameEvent listeners
- Value Tracking - Historical value changes and patterns
- Constraint Validation - Performance impact of validation
4. Issues Tabâ
Automatic detection and categorization of performance issues:
Issue Categories:
đ¨ Critical Issues (Immediate Action Required):
âĸ High Frequency Event: "InputHandler" - 156 raises/sec
â Recommendation: Implement input batching or throttling
â Impact: 15% of total system performance cost
âĸ Memory Leak Detected: "TempDataVariable" - Growing allocation
â Recommendation: Check for listener cleanup in OnDestroy
â Impact: 0.5MB/minute memory growth
â ī¸ Warnings (Optimization Recommended):
âĸ High Listener Count: "GameState" - 23 listeners
â Recommendation: Consider event mediator pattern
â Impact: Potential O(n) performance scaling
âĸ Unused Asset: "DebugCounter" - No activity detected
â Recommendation: Remove if not needed for debugging
â Impact: Memory waste (0.1MB)
âšī¸ Information (Best Practice Suggestions):
âĸ Consider Variable Pooling: 12 variables with similar patterns
âĸ Event Consolidation: 5 similar events could be merged
âĸ Memory Optimization: 3 assets could benefit from lazy initialization
Issue Severity Levels:
- đ¨ Critical - Performance impact > 10ms/frame or memory leaks
- â ī¸ Warning - Optimization opportunities, scaling concerns
- âšī¸ Info - Best practice suggestions, minor improvements
5. Recommendations Tabâ
AI-powered optimization suggestions and best practices:
General Optimization Tips:
đ Performance Best Practices:
Event Management:
âĸ Use events sparingly - prefer direct variable access when possible
âĸ Unsubscribe from events in OnDestroy/OnDisable to prevent memory leaks
âĸ Consider using UnityEvents for UI-only communications
âĸ Batch multiple variable changes when possible
âĸ Use SetValueSilent for initialization to avoid unnecessary events
Memory Management:
âĸ Implement object pooling for frequently created/destroyed listeners
âĸ Use weak references for temporary event subscriptions
âĸ Clear event listeners during scene transitions
âĸ Monitor memory usage in Profiler alongside SOAP Analyzer
Architecture Patterns:
âĸ Use mediator pattern for events with 10+ listeners
âĸ Consider command pattern for complex event chains
âĸ Implement event aggregation for related notifications
âĸ Use async/await patterns for heavy event processing
Project-Specific Recommendations: Based on your current project analysis, the system provides tailored suggestions:
đ¯ Your Project Recommendations:
High Priority:
1. Optimize "PlayerInputHandler" - Currently consuming 23% of event budget
â Implement input buffering with 60fps throttling
â Expected improvement: 15ms/frame reduction
2. Consolidate UI Events - 8 similar UI events detected
â Merge into single parameterized event
â Expected improvement: 40% listener reduction
3. Memory Cleanup - 3 potential memory leaks identified
â Add proper OnDestroy cleanup in PlayerController.cs:45
â Expected improvement: Prevent 2MB/hour memory growth
Medium Priority:
4. Variable Batching - 12 variables updated in same frame
5. Event Mediator - GameState has 18 listeners, consider mediator
6. Asset Cleanup - 5 unused assets consuming 1.2MB
Advanced Performance Featuresâ
Hotspot Detectionâ
Sophisticated algorithm for identifying performance bottlenecks:
Detection Criteria:
đĨ Automatic Hotspot Detection:
Critical Thresholds:
âââ Event Frequency > 30 raises/second
âââ Variable Changes > 20 changes/second
âââ Listener Count > 20 per asset
âââ Memory Growth > 1MB/minute
âââ Update Time > 5ms per asset
Warning Thresholds:
âââ Event Frequency > 10 raises/second
âââ Variable Changes > 8 changes/second
âââ Listener Count > 10 per asset
âââ Memory Usage > 5MB total
âââ Update Time > 2ms per asset
Smart Analysis:
âââ Trend Detection (performance degradation over time)
âââ Spike Identification (sudden performance changes)
âââ Pattern Recognition (cyclic performance issues)
âââ Correlation Analysis (related performance problems)
Hotspot Visualization:
- Heat Map Display - Visual representation of performance intensity
- Performance Graphs - Time-series data showing trends
- Spike Indicators - Highlighting sudden performance changes
- Correlation Lines - Showing relationships between hotspots
Historical Performance Trackingâ
Track performance trends over time for long-term optimization:
Performance History Features:
đ Performance Timeline:
Session History:
âââ Performance snapshots every 30 seconds
âââ Event frequency trends over time
âââ Memory usage patterns
âââ Optimization impact tracking
âââ Performance regression detection
Long-term Tracking:
âââ Daily performance summaries
âââ Performance baselines for comparison
âââ Optimization effectiveness metrics
âââ Team performance reports
âââ Release performance comparison
Trend Analysis:
- Performance Regression Detection - Alerts when performance degrades
- Optimization Impact - Measure effectiveness of optimizations
- Seasonal Patterns - Identify performance patterns over time
- Baseline Comparison - Compare current vs optimal performance
Configurable Monitoringâ
Customize monitoring to match your project needs:
Monitoring Settings:
âī¸ Performance Monitoring Configuration:
Update Frequency:
âââ Real-time (0.1s) - Maximum precision, high overhead
âââ Responsive (0.5s) - Good balance (recommended)
âââ Efficient (1.0s) - Lower overhead for large projects
âââ Background (2.0s) - Minimal impact monitoring
Analysis Depth:
âââ Basic - Core metrics only
âââ Standard - Full analysis (recommended)
âââ Detailed - Deep profiling with call stacks
âââ Debug - Maximum detail for debugging
Alert Thresholds:
âââ Conservative - Fewer alerts, higher thresholds
âââ Balanced - Recommended settings
âââ Aggressive - Early detection, more alerts
âââ Custom - Define your own thresholds
Performance Optimization Workflowsâ
Real-Time Optimization Processâ
Step-by-step process for addressing performance issues:
1. Detection Phase:
đ¯ Performance Issue Detection:
1. Monitor Overview tab during typical gameplay
2. Watch for hotspot indicators (đĨ icons)
3. Check Issues tab for automatically detected problems
4. Review system health score trends
2. Analysis Phase:
đ Deep Performance Analysis:
1. Switch to specific tab (Events/Variables) for hotspot
2. Review detailed metrics and timing data
3. Check listener counts and memory usage
4. Analyze frequency patterns and spikes
5. Identify root cause from usage patterns
3. Optimization Phase:
đ Apply Performance Optimizations:
1. Follow specific recommendations from Issues tab
2. Implement suggested architectural changes
3. Monitor real-time impact of changes
4. Verify improvements in Overview tab
5. Document optimization decisions
4. Validation Phase:
â
Validate Optimization Success:
1. Run extended Play Mode testing
2. Compare before/after performance metrics
3. Ensure no new issues introduced
4. Update performance baselines
5. Share results with team
Production Performance Monitoringâ
Best practices for maintaining performance in shipped games:
Pre-Release Checklist:
đ Performance Release Checklist:
Architecture Review:
â No Critical performance issues
â All hotspots optimized or documented
â Memory usage within budget (< 10MB SOAP overhead)
â Event frequency under control (< 100 total/sec)
â Unused assets removed
Performance Validation:
â Extended gameplay session without degradation
â Memory stable over 30+ minute sessions
â Performance consistent across target devices
â No memory leaks detected
â GC impact minimized
Documentation:
â Performance characteristics documented
â Known performance limitations noted
â Optimization opportunities identified
â Monitoring strategy defined
â Team training completed
Post-Release Monitoring:
- Performance Telemetry - Collect performance data from live games
- Regression Detection - Monitor for performance degradation in updates
- Optimization Planning - Plan future optimizations based on real usage data
Integration with Unity Profilerâ
Seamless integration with Unity's built-in profiling tools:
Profiler Integrationâ
Automatic Profiler Markers:
// SOAP Performance Analyzer automatically adds profiler markers:
Profiler.BeginSample("SOAP.Event.Raise: " + eventName);
Profiler.BeginSample("SOAP.Variable.Set: " + variableName);
Profiler.BeginSample("SOAP.Listener.Notify: " + listenerCount);
// View in Unity Profiler:
âââ SOAP Performance
âââ Event System (2.1ms)
â âââ PlayerHealth.Raise (0.8ms)
â âââ GameState.Raise (0.6ms)
â âââ InputHandler.Raise (0.7ms)
âââ Variable System (1.3ms)
âââ PlayerPosition.Set (0.4ms)
âââ UICounter.Set (0.5ms)
âââ GameScore.Set (0.4ms)
Cross-Tool Workflow:
- SOAP Analyzer - Identify performance hotspots
- Unity Profiler - Deep dive into specific frame analysis
- SOAP Analyzer - Validate optimization effectiveness
- Unity Profiler - Confirm system-wide improvement
Team Collaboration Featuresâ
Performance Reportsâ
Generate detailed performance reports for team sharing:
Automated Reports:
đ SOAP Performance Report - [Project Name]
Generated: [Date/Time] | Session: 45 minutes | Build: v1.2.3
Executive Summary:
âââ Overall Health: đĸ Good (84/100)
âââ Critical Issues: 0
âââ Warnings: 3
âââ Memory Usage: 2.1MB (within budget)
âââ Optimization Opportunities: 5 identified
Performance Highlights:
âââ Top Performer: UIManager - 0.1ms average
âââ Biggest Improvement: InputSystem - 60% faster after optimization
âââ Memory Champion: GameStateController - 0.05MB usage
âââ Most Active: PlayerHealthSystem - 1,247 events processed
Action Items:
1. [HIGH] Optimize PlayerInputHandler frequency (assigned to: @developer)
2. [MED] Implement event batching in UISystem (assigned to: @ui-team)
3. [LOW] Clean up 5 unused debug assets (assigned to: @intern)
Trends:
âââ Event frequency stable over session
âââ Memory usage grew 0.2MB (acceptable)
âââ No performance regressions detected
âââ 3 optimizations successfully implemented
Team Dashboardâ
Share performance insights across your development team:
Dashboard Features:
- Team Performance Goals - Shared performance targets and budgets
- Optimization Tracking - Track who implemented what optimizations
- Performance History - Team-wide performance trend tracking
- Knowledge Sharing - Best practices and successful optimization patterns
Troubleshootingâ
Common Performance Issuesâ
Q: "High event frequency but can't find the cause" A: Use detailed event tracking:
- Switch to Events tab and sort by frequency
- Enable "Show Recent Activity" to see exact timing
- Use Unity Profiler integration for call stack analysis
- Check for event loops (events triggering other events)
Q: "Memory usage keeps growing" A: Identify memory leaks:
- Monitor Variables tab for growing memory usage
- Check Issues tab for leak detection alerts
- Review listener cleanup in component OnDestroy methods
- Use "Clear Data" button to reset tracking and isolate leaks
Q: "Performance good in editor but poor in build" A: Validate build performance:
- Enable Development Build with profiler support
- Connect Performance Analyzer to running build
- Compare editor vs build metrics in Overview tab
- Check for build-specific optimization differences
Debug Configurationâ
Advanced debugging options for complex issues:
đ§ Advanced Debug Settings:
Deep Analysis Mode:
âââ Call Stack Tracking: Yes/No
âââ Memory Allocation Tracking: Yes/No
âââ Cross-Thread Event Detection: Yes/No
âââ Reflection Performance Impact: Yes/No
âââ Full GC Impact Analysis: Yes/No
Logging Configuration:
âââ Log Level: Error/Warning/Info/Debug/Verbose
âââ Performance Logs: Yes/No
âââ Memory Logs: Yes/No
âââ Event Trace Logs: Yes/No
âââ Optimization Logs: Yes/No
Export Options:
âââ Export Performance Data: CSV/JSON/XML
âââ Export Optimization Report: PDF/MD/HTML
âââ Export Debug Logs: TXT/LOG
âââ Export Profiler Data: Unity Profiler Format
The SOAP Performance Analyzer is your comprehensive solution for maintaining high-performance SOAP architectures. It transforms performance optimization from guesswork into data-driven decisions, ensuring your game runs smoothly across all platforms! âĄđ
Next Stepsâ
- Dependency Visualizer - Understand your SOAP architecture relationships
- Debug Window - Debug performance issues in real-time
- Best Practices - Performance optimization guidelines