QueueBenchmark set max read at once
authorDave Watson <davejwatson@fb.com>
Fri, 11 Apr 2014 18:56:35 +0000 (11:56 -0700)
committerDave Watson <davejwatson@fb.com>
Tue, 20 May 2014 19:53:56 +0000 (12:53 -0700)
Summary: Makes a fair comparison between asox queue and notification queue.  THe updated benchmark is just noise in this diff, notificationqueue isn't fast enough (yet) to make a difference.

Test Plan:
fbconfig common/concurrency; fbmake opt
./common/concurrency/QueueBenchmark.sh

Reviewed By: afrind@fb.com

FB internal diff: D1272859

folly/io/async/EventBase.cpp
folly/io/async/EventBase.h

index 6e860406473f0d47c78b96a40c6d8855f5d3004a..71b05c43048c1138570fcf14362c17e1013e5a3f 100644 (file)
@@ -190,6 +190,10 @@ int EventBase::getNotificationQueueSize() const {
   return queue_->size();
 }
 
+void EventBase::setMaxReadAtOnce(uint32_t maxAtOnce) {
+  fnRunner_->setMaxReadAtOnce(maxAtOnce);
+}
+
 // Set smoothing coefficient for loop load average; input is # of milliseconds
 // for exp(-1) decay.
 void EventBase::setLoadAvgMsec(uint32_t ms) {
index 46c84b8d9a803bb2a1d287f22ca7452ff76a090c..fdee81348b13ca27ef7877c723fc3f4c3475d43e 100644 (file)
@@ -345,6 +345,8 @@ class EventBase : private boost::noncopyable, public TimeoutManager {
 
   int getNotificationQueueSize() const;
 
+  void setMaxReadAtOnce(uint32_t maxAtOnce);
+
   /**
    * Verify that current thread is the EventBase thread, if the EventBase is
    * running.