Performance Optimization
Keep your routing setup fast and responsive.
Latency Goals
Target latencies for live performance:
- Core routing: <1ms
- Simple transforms: <2ms
- Scripts: <5ms
- AI Companion: <50ms
Optimization Tips
Minimize Transforms
Each transform adds latency:
- Use only what you need
- Combine transforms when possible
- Remove unused transforms
Optimize Scripts
- Cache lookups — Don't repeat context.get() calls
- Early returns — Exit fast for uninteresting events
- Avoid loops — Use direct calculations
- Minimize allocations — Reuse objects
Reduce Routing Complexity
- Fewer routes — Combine when possible
- Avoid routing loops — Dead-end routes
- Use channel filtering — Don't process unnecessary channels
Monitor Performance
Settings → Performance shows:
- Per-route latency
- Script execution time
- CPU usage
- Memory pressure
Background Processing
Settings → Advanced → Background Priority
- Lower priority for monitoring/visualization
- Realtime priority for routing threads
Hardware Considerations
Apple Silicon
- Neural Engine for AI Companion
- GPU acceleration for visualization
- Performance cores for routing
Intel Mac
- Optimize script complexity
- Disable heavy visualizations during performance
- Consider external MIDI interface for lower latency
iPad/iPhone
- iOS 15+ for best performance
- Background mode for continued routing
- Airplane mode to reduce interference
Troubleshooting High Latency
- Check Route Editor stats — Identify slow routes
- Profile scripts — Use Troubleshooting Mode
- Simplify transforms — Remove or optimize
- Close background apps — Free CPU/memory
- Restart app — Clear accumulated state
Next Steps
- Monitoring — Track performance stats
- NeuroScript routing model — Execution model and scheduling
- Troubleshooting — Fix latency issues
