Commit d4619709 authored by Charles 'Buck' Krasic's avatar Charles 'Buck' Krasic Committed by Commit Bot

QUIC - increase buffer size to improve upload performance.

Increase the size of QuicHttpStream::raw_request_body_buf_ based on the
size of the body.  For large bodies and fast networks, this give a nice
reduction in CPU (or boost throughput if CPU bound) (~10-20%).

R=rch@chromium.org

Bug: 709144
Change-Id: If4fc69f9f89866b75b6d09d728e53a7bfa2054e4
Reviewed-on: https://chromium-review.googlesource.com/581877Reviewed-by: default avatarBuck Krasic <ckrasic@chromium.org>
Reviewed-by: default avatarRyan Hamilton <rch@chromium.org>
Commit-Queue: Buck Krasic <ckrasic@chromium.org>
Cr-Commit-Position: refs/heads/master@{#488765}
parent 723df8d8
......@@ -222,10 +222,12 @@ int QuicHttpStream::SendRequest(const HttpRequestHeaders& request_headers,
// was being called even if we didn't yet allocate raw_request_body_buf_.
// && (request_body_stream_->size() ||
// request_body_stream_->is_chunked()))
// Use 10 packets as the body buffer size to give enough space to
// help ensure we don't often send out partial packets.
raw_request_body_buf_ =
new IOBufferWithSize(static_cast<size_t>(10 * kMaxPacketSize));
// Set the body buffer size to be the size of the body clamped
// into the range [10 * kMaxPacketSize, 256 * kMaxPacketSize].
// With larger bodies, larger buffers reduce CPU usage.
raw_request_body_buf_ = new IOBufferWithSize(static_cast<size_t>(std::max(
10 * kMaxPacketSize,
std::min(request_body_stream_->size(), 256 * kMaxPacketSize))));
// The request body buffer is empty at first.
request_body_buf_ = new DrainableIOBuffer(raw_request_body_buf_.get(), 0);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment