You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In #89165 I updated Read::read_to_end to try to detect EOF when the input buffer is full by reading into a small "probe" buffer. If that read returns Ok(0) then it avoids unnecessarily doubling the capacity of the input buffer.
I think there'd be some value in trying to eliminate even the "probe buffer" call, but in the meantime, this seems like an improvement.
I thought a way: use read_vectored. I could add the probe buffer to a vectorized readv, which would eliminate the extra read syscall.
Is that idea worth pursuing?
Is it okay to simply switch the read call(s) to read_vectored, or would it be better to check is_read_vectored and have separate vectorized and non-vectorized code paths? I'm inclined to keep it simple and do the former.