- Add MAX_PEERS limit to prevent memory exhaustion
- Check message sequence early to drop duplicates before expensive verify
- Simplify peer update logic by removing redundant checks
- Cache peer public keys to avoid repeated key creation
- Increase peer cleanup interval from 2.5s to 15s to reduce overhead
- Adjust cleanup check interval from 500ms to 5s
Added rate limiting to broadcast updates to once per second and cap visual particles at 500 to prevent browser crashes from excessive rendering. Stop ruining my fun.