Todd Lipcon has submitted this change and it was merged. ( )

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

Change-Id: I3b6be5ef7e8f464f3bc4c62f904e2692b30ddc65
Tested-by: Kudu Jenkins
Reviewed-by: Michael Ho <>
Reviewed-by: Todd Lipcon <>
M src/kudu/rpc/
M src/kudu/rpc/
M src/kudu/rpc/reactor.h
3 files changed, 48 insertions(+), 10 deletions(-)

  Kudu Jenkins: Verified
  Michael Ho: Looks good to me, but someone else must approve
  Todd Lipcon: Looks good to me, approved

To view, visit
To unsubscribe, visit

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I3b6be5ef7e8f464f3bc4c62f904e2692b30ddc65
Gerrit-Change-Number: 9048
Gerrit-PatchSet: 4
Gerrit-Owner: Todd Lipcon <>
Gerrit-Reviewer: Adar Dembo <>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Michael Ho <>
Gerrit-Reviewer: Tidy Bot
Gerrit-Reviewer: Todd Lipcon <>

Reply via email to