๐ Performance Considerations
Optimization Features
Proximity Calculation
O(n) complexity per message
Entity coordinate caching
Efficient distance calculation
Config Loading
JSON cached in memory
Lazy loading of Discord data
Async API calls with timeouts
Player Data Caching
Cached on join
Cleaned on disconnect
Periodic refresh for roles only (30 min)
React UI
Optimized re-renders
Message grouping reduces DOM nodes
Efficient state management
Resource Usage
Memory: ~50-100MB (depending on player count)
CPU: Minimal impact (<1% per message)
Network: Efficient event broadcasting
Disk: Config file only (~10-50KB)
Performance Benchmarks
Proximity calculation (100 players)
<5ms
Config load
<10ms
Config save
<50ms
Discord API fetch
<200ms (with cache)
Message broadcast
<1ms
Best Practices
Limit Chat Modes: Don't create too many modes (recommended: <20)
Reasonable Cooldowns: Use cooldowns to prevent spam
Proximity Ranges: Keep distances reasonable (<100m)
Config Validation: Always validate before major changes
Backup Config: Backup before experimenting
Last updated