Todd Lipcon has submitted this change and it was merged. ( http://gerrit.cloudera.org:8080/15441 )
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 Reviewed-on: http://gerrit.cloudera.org:8080/15441 Tested-by: Kudu Jenkins Reviewed-by: Bankim Bhavsar <[email protected]> Reviewed-by: Adar Dembo <[email protected]> --- M src/kudu/rpc/proxy.cc A src/kudu/util/notification.h 2 files changed, 142 insertions(+), 6 deletions(-) Approvals: Kudu Jenkins: Verified Bankim Bhavsar: Looks good to me, but someone else must approve Adar Dembo: Looks good to me, approved -- 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: merged Gerrit-Change-Id: I1b65cce8bd48ee7edf6b2d08e96d00681c32aa97 Gerrit-Change-Number: 15441 Gerrit-PatchSet: 3 Gerrit-Owner: Todd Lipcon <[email protected]> Gerrit-Reviewer: Adar Dembo <[email protected]> Gerrit-Reviewer: Bankim Bhavsar <[email protected]> Gerrit-Reviewer: Kudu Jenkins (120) Gerrit-Reviewer: Todd Lipcon <[email protected]>
