Support QUIC read coalescing if possible in Cronet |
|
Issue descriptionCronet embedders have noticed when enabling QUIC that Cronet goes from completely filling ByteBuffers passed to Cronet, to just filling one packet's worth (~1400 bytes of payload) in the buffer. I wonder if we could eek out a bit more performance by checking if more data is available and more completely filling the buffers (i.e don't block waiting for more data, but if the data is ready by the time we intend on issuing a onReadCompleted callback to the app, append it to the buffer). The possible performance boost would come from decreasing the round-trips through the Cronet API. I don't know if more data is really available, or if the performance boost would be significant, but I wanted to file this potential optimization idea so I didn't forget. I also don't know which level of the network stack this kind of optimization should take place in.
,
Apr 4 2018
All sounds plausible to me. I think this has to be done inside the network stack, not in Cronet. My reasoning: We don't have a peek API AFAIK. So say caller passes a big buffer to Cronet to fill. Cronet calls UrlRequest.Read() and gets back 1400 bytes, but the problem is Cronet can't call UrlRequest.Read() again because that might give back ERR_IO_PENDING and hold onto the buffer for an indeterminate amount of time when we should be passing the buffer back to the app in this async case. |
|
►
Sign in to add a comment |
|
Comment 1 by rch@chromium.org
, Apr 3 2018