Andrew Wong has posted comments on this change. ( http://gerrit.cloudera.org:8080/16063 )
Change subject: [util] improved performance of BlockingQueue ...................................................................... Patch Set 3: (2 comments) http://gerrit.cloudera.org:8080/#/c/16063/3/src/kudu/util/blocking_queue.h File src/kudu/util/blocking_queue.h: http://gerrit.cloudera.org:8080/#/c/16063/3/src/kudu/util/blocking_queue.h@149 PS3, Line 149: QueueStatus Put(const T& val) { Same here, why not wrap the r-value Put()? http://gerrit.cloudera.org:8080/#/c/16063/3/src/kudu/util/blocking_queue.h@192 PS3, Line 192: if (PREDICT_FALSE(deadline.Initialized() && MonoTime::Now() > deadline)) { : return Status::TimedOut(""); : } : MutexLock l(lock_); : while (true) { : if (PREDICT_FALSE(shutdown_)) { : return Status::Aborted(""); : } : if (size_ < max_size_) { : increment_size_unlocked(val); : queue_.emplace_back(val); : l.Unlock(); : not_empty_.Signal(); : return Status::OK(); : } : if (!deadline.Initialized()) { : not_full_.Wait(); : } else if (PREDICT_FALSE(!not_full_.WaitUntil(deadline))) { : return Status::TimedOut(""); : } : } Isn't it safe to pass a const ref as an r-value? E.g. why not just wrap the below BlockingPut()? -- To view, visit http://gerrit.cloudera.org:8080/16063 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: kudu Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ie80620e5e86cd72c29320096dcdcc712eea1b0f2 Gerrit-Change-Number: 16063 Gerrit-PatchSet: 3 Gerrit-Owner: Alexey Serbin <aser...@cloudera.com> Gerrit-Reviewer: Alexey Serbin <aser...@cloudera.com> Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com> Gerrit-Reviewer: Bankim Bhavsar <ban...@cloudera.com> Gerrit-Reviewer: Kudu Jenkins (120) Gerrit-Reviewer: Todd Lipcon <t...@apache.org> Gerrit-Comment-Date: Thu, 11 Jun 2020 13:03:32 +0000 Gerrit-HasComments: Yes