As part of our commitment to building a high-performance server (fulfilling the "Mesurer, tester et optimiser les performances techniques" track objective), we have defined key performance indicators (KPIs) and implemented stress-testing procedures.
To ensure the server remains stable and fast under load, we monitor the following metrics:
Tick Time (MSPT - Milliseconds Per Tick)
Memory Footprint per Player
Client is spawned and associated network buffers are created.Codec Latency
void-codec to serialize/deserialize packet buffers on the Tokio network thread before passing them to the Bevy game thread via Flume channels.We utilize dummy client generators attempting to connect concurrently to measure how our Tokio runtime handles peak connection limits (epoll saturation) and how the Bevy ECS scales with lots of empty Entities.
Player components effortlessly.Before Optimization:
Using generic locking (Mutext/RwLock) to transfer packets from network to game thread caused severe synchronization contention under high load.
After Optimization:
Implementing lock-free channels (flume) strictly separates the network I/O from the game loop block. The thread synchronization times dropped significantly, maintaining the Tick Time (MSPT) under the 50ms threshold even with heavy I/O.
Developers can use cargo bench to assert the encoding and decoding speeds of typical packets (like ChunkData), ensuring new protocol additions do not regress the Codec Latency metric.