Commit af3fa519 authored by Pavlo Kushnir's avatar Pavlo Kushnir Committed by facebook-github-bot-1

Do not set startWork_ in EventBase if time measurement is disabled

Summary: startWork_ is used only if enableTimeMeasurement is set. It gives ~0.5% performance win for mcrouter.

Reviewed By: yfeldblum

Differential Revision: D2590176

fb-gh-sync-id: 07f2189ebdec751cd0d91d191d8f595780d2808a
parent f3199c1a
......@@ -459,12 +459,14 @@ bool EventBase::bumpHandlingTime() {
" (loop) latest " << latestLoopCnt_ << " next " << nextLoopCnt_;
if(nothingHandledYet()) {
latestLoopCnt_ = nextLoopCnt_;
if (enableTimeMeasurement_) {
// set the time
startWork_ = std::chrono::duration_cast<std::chrono::microseconds>(
std::chrono::steady_clock::now().time_since_epoch()).count();
VLOG(11) << "EventBase " << this << " " << __PRETTY_FUNCTION__ <<
" (loop) startWork_ " << startWork_;
}
return true;
}
return false;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment