AsyncSocketHandler cacheChainLength
authorDave Watson <davejwatson@fb.com>
Wed, 8 Apr 2015 17:45:08 +0000 (10:45 -0700)
committerViswanath Sivakumar <viswanath@fb.com>
Fri, 10 Apr 2015 03:34:35 +0000 (20:34 -0700)
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

folly/wangle/channel/AsyncSocketHandler.h

index 5fc0b680092e31ad9472fced18f353d91c326234..b5be966f331b37806b9930734d8a800ccc560f71 100644 (file)
@@ -146,7 +146,7 @@ class AsyncSocketHandler
   };
 
   Context* ctx_{nullptr};
-  folly::IOBufQueue bufQueue_;
+  folly::IOBufQueue bufQueue_{folly::IOBufQueue::cacheChainLength()};
   std::shared_ptr<AsyncSocket> socket_{nullptr};
 };