aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/lib/iomgr/tcp_posix.cc
diff options
context:
space:
mode:
authorGravatar Soheil Hassas Yeganeh <soheil@google.com>2018-10-11 15:28:49 -0400
committerGravatar Soheil Hassas Yeganeh <soheil@google.com>2018-10-11 15:28:49 -0400
commit78434ad30360583ab4f71c1aca1dc3e850a31e98 (patch)
tree84919c32e12b06feaec73bddd39c0a17a97f8e91 /src/core/lib/iomgr/tcp_posix.cc
parentc8d5db17173318ff5efe3e0721bca3340251f738 (diff)
Do not wait for allocation if buffer is less than half the target.
We overallocate by 2x for target. Unless buffer is more than half full, we should not delay read for more allocation.
Diffstat (limited to 'src/core/lib/iomgr/tcp_posix.cc')
-rw-r--r--src/core/lib/iomgr/tcp_posix.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/core/lib/iomgr/tcp_posix.cc b/src/core/lib/iomgr/tcp_posix.cc
index 7fd0e91346..aa2704ce26 100644
--- a/src/core/lib/iomgr/tcp_posix.cc
+++ b/src/core/lib/iomgr/tcp_posix.cc
@@ -500,7 +500,7 @@ static void tcp_read_allocation_done(void* tcpp, grpc_error* error) {
static void tcp_continue_read(grpc_tcp* tcp) {
size_t target_read_size = get_target_read_size(tcp);
- if (tcp->incoming_buffer->length < target_read_size &&
+ if (tcp->incoming_buffer->length < target_read_size / 2 &&
tcp->incoming_buffer->count < MAX_READ_IOVEC) {
if (grpc_tcp_trace.enabled()) {
gpr_log(GPR_INFO, "TCP:%p alloc_slices", tcp);