Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use the
WorkLimiter
in the Endpoint
receive path
This changes the `Endpoint`s `drive_recv` method to limit receive operations based on the amount of spent time (to 50µs) using the `WorkLimiter`, instead of using the hardcoded `IO_LOOP_BOUND` counter. Performance differences are negligible on this machine (probably because `IO_LOOP_BOUND` was set to a number which works for it), but it can improve things on less known environments. I instrumented the endpoints receive method to see how much time it spends on average in `drive_recv`. **Baseline:** ``` Recv time: AvgTime { total: 3.280880841s, calls: 34559, avg: 94.935µs, min: 3.146µs, max: 312.574µs } path: PathStats { rtt: 511.656µs, ``` **With this change:** ``` Recv time: AvgTime { total: 3.333642823s, calls: 54627, avg: 61.024µs, min: 2.645µs, max: 319.147µs } path: PathStats { rtt: 446.641µs, ``` Note that 50µs are not reached because a single `recvmmsg` batch takes about 30µs, so this is just rounding up to 2 batches. **When set to 200µs (for comparison purposes):** ``` Recv time: AvgTime { total: 3.243954076s, calls: 19558, avg: 165.862µs, min: 2.525µs, max: 358.711µs } path: PathStats { rtt: 700.34µs, } ```
- Loading branch information