Hello Adar Dembo,

I'd like you to do a code review. Please visit

    http://gerrit.cloudera.org:8080/15441

to review the following change.


Change subject: rpc: use a lighter weight completion for sync RPCs
......................................................................

rpc: use a lighter weight completion for sync RPCs

This adds a new Notification class which is a special purpose
CountDownLatch with count 1, implemented on top of futex. This ends up
being a bit more efficient than the pthread-based mutex and condition
variable.

Benchmarked with rpc-bench 40 times each before and after and ran
t-tests on the reported metrics:

User CPU (statistically significant 4-8% reduction):

data:  subset(d, V1 == "with")$V2 and subset(d, V1 == "without")$V2
t = -6.1821, df = 74.559, p-value = 3.081e-08
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
 -1.5546221 -0.7968279
sample estimates:
mean of x mean of y
 16.96979  18.14551

System CPU (no significant difference):

data:  subset(d, V1 == "with")$V2 and subset(d, V1 == "without")$V2
t = -0.23148, df = 66.883, p-value = 0.8176
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
 -0.6114441  0.4843641
sample estimates:
mean of x mean of y
 41.03802  41.10156

Context switches (statistically significant 1.6-2.3% reduction):

data:  subset(d, V1 == "with")$V2 and subset(d, V1 == "without")$V2
t = -11.198, df = 77.282, p-value < 2.2e-16
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
 -0.0820182 -0.0572533
sample estimates:
mean of x mean of y
 3.551491  3.621127

Change-Id: I1b65cce8bd48ee7edf6b2d08e96d00681c32aa97
---
M src/kudu/client/resource_metrics-internal.h
M src/kudu/rpc/proxy.cc
A src/kudu/util/notification.h
3 files changed, 145 insertions(+), 3 deletions(-)



  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/41/15441/1
--
To view, visit http://gerrit.cloudera.org:8080/15441
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I1b65cce8bd48ee7edf6b2d08e96d00681c32aa97
Gerrit-Change-Number: 15441
Gerrit-PatchSet: 1
Gerrit-Owner: Todd Lipcon <[email protected]>
Gerrit-Reviewer: Adar Dembo <[email protected]>

Reply via email to