From: Dave Watson Date: Wed, 8 Apr 2015 17:45:08 +0000 (-0700) Subject: AsyncSocketHandler cacheChainLength X-Git-Tag: v0.35.0~7 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=69befbf8072196103046f8a49fce7547310508fa;p=folly.git AsyncSocketHandler cacheChainLength Summary: Is there any reason we shouldn't just cache the chain length everywhere? Currently the pipeline does a lot of passing of buffers between IOBufQueues, I wonder if we can get even smarter about passing the length around Test Plan: used in telnet server diff Reviewed By: hans@fb.com Subscribers: doug, fugalh, folly-diffs@, jsedgwick, yfeldblum, chalfant FB internal diff: D1959167 Signature: t1:1959167:1427934568:eb9a49514b2bb7d157879bb8efa99f12092d5e95 --- diff --git a/folly/wangle/channel/AsyncSocketHandler.h b/folly/wangle/channel/AsyncSocketHandler.h index 5fc0b680..b5be966f 100644 --- a/folly/wangle/channel/AsyncSocketHandler.h +++ b/folly/wangle/channel/AsyncSocketHandler.h @@ -146,7 +146,7 @@ class AsyncSocketHandler }; Context* ctx_{nullptr}; - folly::IOBufQueue bufQueue_; + folly::IOBufQueue bufQueue_{folly::IOBufQueue::cacheChainLength()}; std::shared_ptr socket_{nullptr}; };