Commit be5635b
committed
Reduce CPU load from try_read_inner() by performing a sleeping wait
Currently TryStream::try_read_inner() are part of a busy-loop that waits
for characters. We can make that wait use significantly less CPU by
sleeping until characters are available instead.
This should have no impact on performance providing characters or EOF
are received before reaching the timeout. The 100ms timeout could impact
the responsiveness of Sessions with a short timeouts. Happily these
sessions should be uncommon and their needs could be met by disabling
the polling feature.1 parent 667c8c3 commit be5635b
1 file changed
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
508 | 508 | | |
509 | 509 | | |
510 | 510 | | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
511 | 517 | | |
512 | 518 | | |
513 | 519 | | |
| |||
0 commit comments