Hello Tidy Bot, Mike Percy, Dan Burkert, David Ribeiro Alves, Kudu Jenkins,

I'd like you to reexamine a change. Please visit

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

to look at the new patch set (#2).

Change subject: consensus: avoid extra calls to protobuf SpaceUsed in the log 
cache
......................................................................

consensus: avoid extra calls to protobuf SpaceUsed in the log cache

The SpaceUsed function appears to be somewhat expensive since it walks
the entire protobuf structure. In complex protobufs (like those with
larger schemas) this can cause a lot of cache misses, etc. In fact,
SpaceUsed shows up as one of the top 5 CPU consumers in a YCSB workload
I'm looking at.

This patch adds the cached value of SpaceUsed to the log cache so that
it only needs to be computed upon insertion and not during removal.

Before:
 Performance counter stats for 
'build/latest/bin/full_stack-insert-scan-test.263 
--gtest_filter=*MRSOnlyStressTest* --inserts_per_client=200000 
--concurrent_inserts=10 --rows_per_batch=1 --skip_scans':

     317505.548908      task-clock (msec)         #    5.323 CPUs utilized
        12,461,003      context-switches          #    0.039 M/sec
         3,688,491      cpu-migrations            #    0.012 M/sec
           113,952      page-faults               #    0.359 K/sec
 1,029,595,155,391      cycles                    #    3.243 GHz
   663,514,269,656      instructions              #    0.64  insn per cycle
   125,865,138,975      branches                  #  396.419 M/sec
     1,419,717,877      branch-misses             #    1.13% of all branches

      59.642651558 seconds time elapsed

After:

 Performance counter stats for 'build/latest/bin/full_stack-insert-scan-test 
--gtest_filter=*MRSOnlyStressTest* --inserts_per_client=200000 
--concurrent_inserts=10 --rows_per_batch=1 --skip_scans':

     300152.060785      task-clock (msec)         #    5.308 CPUs utilized
        12,700,694      context-switches          #    0.042 M/sec
         3,733,956      cpu-migrations            #    0.012 M/sec
           113,566      page-faults               #    0.378 K/sec
   988,639,509,530      cycles                    #    3.294 GHz
   622,457,850,144      instructions              #    0.63  insn per cycle
   117,633,251,291      branches                  #  391.912 M/sec
     1,398,704,577      branch-misses             #    1.19% of all branches

      56.551168856 seconds time elapsed

Change-Id: I0439995fb1369a3333b7d5858518d01277b53076
---
M src/kudu/consensus/log_cache.cc
M src/kudu/consensus/log_cache.h
2 files changed, 26 insertions(+), 19 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/93/9093/2
--
To view, visit http://gerrit.cloudera.org:8080/9093
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I0439995fb1369a3333b7d5858518d01277b53076
Gerrit-Change-Number: 9093
Gerrit-PatchSet: 2
Gerrit-Owner: Todd Lipcon <[email protected]>
Gerrit-Reviewer: Dan Burkert <[email protected]>
Gerrit-Reviewer: David Ribeiro Alves <[email protected]>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Mike Percy <[email protected]>
Gerrit-Reviewer: Tidy Bot

Reply via email to