Todd Lipcon has submitted this change and it was merged. ( http://gerrit.cloudera.org:8080/9048 )
Change subject: rpc: micro-optimize delayed task handling ...................................................................... rpc: micro-optimize delayed task handling Previously we put all pending DelayedTasks in an STL set<>. However, we don't really need a set -- using an intrusive doubly linked list is sufficient and provides O(1) removal instead of O(lg n). This speeds up the new unit test significantly. I measured the new test using the following command line before and after three times: periodic-test --gtest_filter=\*Perf\* --gtest_repeat=10 2>&1 | grep User | tee -a /tmp/after and then ran a t-test on the difference in CPU time: data: d.before and d.after t = 19.097, df = 48.327, p-value < 2.2e-16 alternative hypothesis: true difference in means is not equal to 0 95 percent confidence interval: 0.09643424 0.11912596 sample estimates: mean of x mean of y 0.4324359 0.3246558 So this saves a noticeable amount of CPU when there are a lot of pending tasks. Change-Id: I3b6be5ef7e8f464f3bc4c62f904e2692b30ddc65 Reviewed-on: http://gerrit.cloudera.org:8080/9048 Tested-by: Kudu Jenkins Reviewed-by: Michael Ho <k...@cloudera.com> Reviewed-by: Todd Lipcon <t...@apache.org> --- M src/kudu/rpc/periodic-test.cc M src/kudu/rpc/reactor.cc M src/kudu/rpc/reactor.h 3 files changed, 48 insertions(+), 10 deletions(-) Approvals: Kudu Jenkins: Verified Michael Ho: Looks good to me, but someone else must approve Todd Lipcon: Looks good to me, approved -- To view, visit http://gerrit.cloudera.org:8080/9048 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: kudu Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I3b6be5ef7e8f464f3bc4c62f904e2692b30ddc65 Gerrit-Change-Number: 9048 Gerrit-PatchSet: 4 Gerrit-Owner: Todd Lipcon <t...@apache.org> Gerrit-Reviewer: Adar Dembo <a...@cloudera.com> Gerrit-Reviewer: Kudu Jenkins Gerrit-Reviewer: Michael Ho <k...@cloudera.com> Gerrit-Reviewer: Tidy Bot Gerrit-Reviewer: Todd Lipcon <t...@apache.org>