Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
quic tpu: create fewer timeout futures
Use a cancellation token instead of polling an Arc<bool> to exit connection tasks. Before this change we used to create a timeout future for each tx, and immediately cancel it since virtually all connections always have incoming tx pending. Cancelling timeout futures is expensive as it goes inside the tokio driver and takes a mutex. On high load (1M tps), cancelling timeout futures takes 8% (!) of run time. With this change we create a cancellation token _once_ when a connection is established and that's it - no overhead after that.
- Loading branch information