You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@kudu.apache.org by "Todd Lipcon (Code Review)" <ge...@cloudera.org> on 2017/11/01 20:02:58 UTC

[kudu-CR] compaction policy: don't run a compaction if it provides very little improvement

Hello zhen.zhang, Adar Dembo,

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

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

to review the following change.


Change subject: compaction_policy: don't run a compaction if it provides very little improvement
......................................................................

compaction_policy: don't run a compaction if it provides very little improvement

In the case that a compaction only results in a tiny amount of
improvement (eg reducing height in only 1% of the key space or less)
then we should not bother to run it. This patch implements this short
circuit behavior and also ensures that we short-circuit the compaction
policy calculation early as soon as we can see that we aren't going to
find a worthwhile compaction.

This provided a huge speedup on evaluating the compaction policies for cases
where the rowsets don't (or minimally) overlap.

Original:
 Performance counter stats for 'build/latest/bin/compaction_policy-test --gtest_filter=*TinyOver*' (10 runs):

       6475.676701      task-clock (msec)         #    1.000 CPUs utilized            ( +-  1.35% )
                10      context-switches          #    0.001 K/sec                    ( +- 29.76% )
                 0      cpu-migrations            #    0.000 K/sec                    ( +-100.00% )
             2,505      page-faults               #    0.387 K/sec                    ( +-  4.24% )
    24,174,771,160      cycles                    #    3.733 GHz                      ( +-  0.50% )
    79,871,269,334      instructions              #    3.30  insn per cycle           ( +-  0.00% )
    14,113,123,041      branches                  # 2179.405 M/sec                    ( +-  0.00% )
        58,160,529      branch-misses             #    0.41% of all branches          ( +-  0.02% )

       6.476139848 seconds time elapsed                                          ( +-  1.35% )

With patch:
 Performance counter stats for 'build/latest/bin/compaction_policy-test --gtest_filter=*TinyOver*' (10 runs):

        426.861117      task-clock (msec)         #    0.999 CPUs utilized            ( +-  0.87% )
                 2      context-switches          #    0.004 K/sec                    ( +- 23.13% )
                 0      cpu-migrations            #    0.000 K/sec
             2,476      page-faults               #    0.006 M/sec                    ( +-  4.38% )
     1,597,139,052      cycles                    #    3.742 GHz                      ( +-  0.67% )
     4,013,990,056      instructions              #    2.51  insn per cycle           ( +-  0.01% )
       628,035,462      branches                  # 1471.288 M/sec                    ( +-  0.01% )
         2,408,063      branch-misses             #    0.38% of all branches          ( +-  0.13% )

       0.427287921 seconds time elapsed                                          ( +-  0.86% )

Change-Id: I2522f960ee5413b54c9936721eef5ef200586bc9
---
M src/kudu/tablet/compaction_policy.cc
1 file changed, 22 insertions(+), 3 deletions(-)



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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I2522f960ee5413b54c9936721eef5ef200586bc9
Gerrit-Change-Number: 8444
Gerrit-PatchSet: 1
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: zhen.zhang <zh...@xiaomi.com>

[kudu-CR] compaction policy: don't run a compaction if it provides very little improvement

Posted by "Adar Dembo (Code Review)" <ge...@cloudera.org>.
Adar Dembo has posted comments on this change. ( http://gerrit.cloudera.org:8080/8444 )

Change subject: compaction_policy: don't run a compaction if it provides very little improvement
......................................................................


Patch Set 1: Code-Review+2


-- 
To view, visit http://gerrit.cloudera.org:8080/8444
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I2522f960ee5413b54c9936721eef5ef200586bc9
Gerrit-Change-Number: 8444
Gerrit-PatchSet: 1
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: zhen.zhang <zh...@xiaomi.com>
Gerrit-Comment-Date: Wed, 01 Nov 2017 20:45:06 +0000
Gerrit-HasComments: No

[kudu-CR] compaction policy: don't run a compaction if it provides very little improvement

Posted by "Todd Lipcon (Code Review)" <ge...@cloudera.org>.
Todd Lipcon has posted comments on this change. ( http://gerrit.cloudera.org:8080/8444 )

Change subject: compaction_policy: don't run a compaction if it provides very little improvement
......................................................................


Patch Set 2: Verified+1 Code-Review+2

Unrelated flake. Carrying over +2 from earlier rev.


-- 
To view, visit http://gerrit.cloudera.org:8080/8444
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I2522f960ee5413b54c9936721eef5ef200586bc9
Gerrit-Change-Number: 8444
Gerrit-PatchSet: 2
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: zhen.zhang <zh...@xiaomi.com>
Gerrit-Comment-Date: Wed, 01 Nov 2017 23:17:17 +0000
Gerrit-HasComments: No

[kudu-CR] compaction policy: don't run a compaction if it provides very little improvement

Posted by "Todd Lipcon (Code Review)" <ge...@cloudera.org>.
Todd Lipcon has submitted this change and it was merged. ( http://gerrit.cloudera.org:8080/8444 )

Change subject: compaction_policy: don't run a compaction if it provides very little improvement
......................................................................

compaction_policy: don't run a compaction if it provides very little improvement

In the case that a compaction only results in a tiny amount of
improvement (eg reducing height in only 1% of the key space or less)
then we should not bother to run it. This patch implements this short
circuit behavior and also ensures that we short-circuit the compaction
policy calculation early as soon as we can see that we aren't going to
find a worthwhile compaction.

This provided a huge speedup on evaluating the compaction policies for cases
where the rowsets don't (or minimally) overlap.

Original:
 Performance counter stats for 'build/latest/bin/compaction_policy-test --gtest_filter=*TinyOver*' (10 runs):

       6475.676701      task-clock (msec)         #    1.000 CPUs utilized            ( +-  1.35% )
                10      context-switches          #    0.001 K/sec                    ( +- 29.76% )
                 0      cpu-migrations            #    0.000 K/sec                    ( +-100.00% )
             2,505      page-faults               #    0.387 K/sec                    ( +-  4.24% )
    24,174,771,160      cycles                    #    3.733 GHz                      ( +-  0.50% )
    79,871,269,334      instructions              #    3.30  insn per cycle           ( +-  0.00% )
    14,113,123,041      branches                  # 2179.405 M/sec                    ( +-  0.00% )
        58,160,529      branch-misses             #    0.41% of all branches          ( +-  0.02% )

       6.476139848 seconds time elapsed                                          ( +-  1.35% )

With patch:
 Performance counter stats for 'build/latest/bin/compaction_policy-test --gtest_filter=*TinyOver*' (10 runs):

        426.861117      task-clock (msec)         #    0.999 CPUs utilized            ( +-  0.87% )
                 2      context-switches          #    0.004 K/sec                    ( +- 23.13% )
                 0      cpu-migrations            #    0.000 K/sec
             2,476      page-faults               #    0.006 M/sec                    ( +-  4.38% )
     1,597,139,052      cycles                    #    3.742 GHz                      ( +-  0.67% )
     4,013,990,056      instructions              #    2.51  insn per cycle           ( +-  0.01% )
       628,035,462      branches                  # 1471.288 M/sec                    ( +-  0.01% )
         2,408,063      branch-misses             #    0.38% of all branches          ( +-  0.13% )

       0.427287921 seconds time elapsed                                          ( +-  0.86% )

Change-Id: I2522f960ee5413b54c9936721eef5ef200586bc9
Reviewed-on: http://gerrit.cloudera.org:8080/8444
Reviewed-by: Todd Lipcon <to...@apache.org>
Tested-by: Todd Lipcon <to...@apache.org>
---
M src/kudu/tablet/compaction_policy.cc
1 file changed, 22 insertions(+), 3 deletions(-)

Approvals:
  Todd Lipcon: Looks good to me, approved; Verified

-- 
To view, visit http://gerrit.cloudera.org:8080/8444
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I2522f960ee5413b54c9936721eef5ef200586bc9
Gerrit-Change-Number: 8444
Gerrit-PatchSet: 3
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: zhen.zhang <zh...@xiaomi.com>

[kudu-CR] compaction policy: don't run a compaction if it provides very little improvement

Posted by "Todd Lipcon (Code Review)" <ge...@cloudera.org>.
Todd Lipcon has removed Kudu Jenkins from this change.  ( http://gerrit.cloudera.org:8080/8444 )

Change subject: compaction_policy: don't run a compaction if it provides very little improvement
......................................................................


Removed reviewer Kudu Jenkins with the following votes:

* Verified-1 by Kudu Jenkins (120)
-- 
To view, visit http://gerrit.cloudera.org:8080/8444
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: deleteReviewer
Gerrit-Change-Id: I2522f960ee5413b54c9936721eef5ef200586bc9
Gerrit-Change-Number: 8444
Gerrit-PatchSet: 2
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: zhen.zhang <zh...@xiaomi.com>