From: Dave Watson Date: Fri, 11 Apr 2014 18:56:35 +0000 (-0700) Subject: QueueBenchmark set max read at once X-Git-Tag: v0.22.0~575 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=309fa7e7877add5de7ab1d995c33b569f6545951;p=folly.git QueueBenchmark set max read at once 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 --- diff --git a/folly/io/async/EventBase.cpp b/folly/io/async/EventBase.cpp index 6e860406..71b05c43 100644 --- a/folly/io/async/EventBase.cpp +++ b/folly/io/async/EventBase.cpp @@ -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) { diff --git a/folly/io/async/EventBase.h b/folly/io/async/EventBase.h index 46c84b8d..fdee8134 100644 --- a/folly/io/async/EventBase.h +++ b/folly/io/async/EventBase.h @@ -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.