You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@kudu.apache.org by "Alexey Serbin (Code Review)" <ge...@cloudera.org> on 2022/02/01 06:41:33 UTC

[kudu-CR] [util] optimized version of BitUtil::Ceil()

Alexey Serbin has uploaded this change for review. ( http://gerrit.cloudera.org:8080/18187


Change subject: [util] optimized version of BitUtil::Ceil()
......................................................................

[util] optimized version of BitUtil::Ceil()

This patch introduces an optimized version of BitUtil::Ceil() for the
case when the divisor is a power of two.  As it turns out, all usages
of the BitUtil::Ceil() in Kudu are for divisor of 8, so I updated all
the call sites correspondingly.

This patch also contains the updated RLE benchmark.  The comparison
results are the following for a RELEASE configuration built with
c++ (GCC) 8.3.1 20190311 (Red Hat 8.3.1-3)):

Non-optimized implementation:
  Time spent BooleanBitStream: real 0.487s  user 0.486s     sys 0.001s
  Wrote 1048576 bytes

  Time spent BooleanRLE: real 2.302s     user 2.304s      sys 0.001s
  Wrote 46080 bytes

Optimized implementation:
  Time spent BooleanBitStream: real 0.017s  user 0.016s     sys 0.000s
  Wrote 1048576 bytes

  Time spent BooleanRLE: real 2.055s     user 2.056s      sys 0.001s
  Wrote 46080 bytes

As for benmarking direct calls of these functions:
  Time spent BitUtil::Ceil(..., 8): real 0.306s   user 0.308s     sys 0.000s
  Time spent BitUtil::Ceil<3>(...): real 0.268s   user 0.268s     sys 0.000s

Change-Id: Ia383856aa9a189681f6ee2a0d317476fe3c847bd
---
M src/kudu/benchmarks/rle.cc
M src/kudu/util/bit-stream-utils.h
M src/kudu/util/bit-stream-utils.inline.h
M src/kudu/util/bit-util.h
M src/kudu/util/rle-encoding.h
M src/kudu/util/rle-test.cc
6 files changed, 60 insertions(+), 12 deletions(-)



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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia383856aa9a189681f6ee2a0d317476fe3c847bd
Gerrit-Change-Number: 18187
Gerrit-PatchSet: 1
Gerrit-Owner: Alexey Serbin <as...@cloudera.com>

[kudu-CR] [util] optimized version of BitUtil::Ceil()

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

Change subject: [util] optimized version of BitUtil::Ceil()
......................................................................

[util] optimized version of BitUtil::Ceil()

This patch introduces an optimized version of BitUtil::Ceil() for the
case when the divisor is a power of two.  As it turns out, all usages
of the BitUtil::Ceil() in Kudu are for divisor of 8, so I updated all
the call sites correspondingly.

This patch also contains the updated RLE benchmark.  The comparison
results are the following for a RELEASE configuration built with
c++ (GCC) 8.3.1 20190311 (Red Hat 8.3.1-3)):

Non-optimized implementation:
  Time spent BooleanBitStream: real 0.487s  user 0.486s     sys 0.001s
  Wrote 1048576 bytes

  Time spent BooleanRLE: real 2.302s     user 2.304s      sys 0.001s
  Wrote 46080 bytes

Optimized implementation:
  Time spent BooleanBitStream: real 0.017s  user 0.016s     sys 0.000s
  Wrote 1048576 bytes

  Time spent BooleanRLE: real 2.055s     user 2.056s      sys 0.001s
  Wrote 46080 bytes

As for benmarking direct calls of these functions:
  Time spent BitUtil::Ceil(..., 8): real 0.720s  user 0.721s     sys 0.000s
  Time spent BitUtil::Ceil<3>(...): real 0.402s  user 0.402s     sys 0.000s

Change-Id: Ia383856aa9a189681f6ee2a0d317476fe3c847bd
Reviewed-on: http://gerrit.cloudera.org:8080/18187
Tested-by: Kudu Jenkins
Reviewed-by: Attila Bukor <ab...@apache.org>
---
M src/kudu/benchmarks/rle.cc
M src/kudu/util/bit-stream-utils.h
M src/kudu/util/bit-stream-utils.inline.h
M src/kudu/util/bit-util.h
M src/kudu/util/rle-encoding.h
M src/kudu/util/rle-test.cc
6 files changed, 55 insertions(+), 12 deletions(-)

Approvals:
  Kudu Jenkins: Verified
  Attila Bukor: Looks good to me, approved

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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ia383856aa9a189681f6ee2a0d317476fe3c847bd
Gerrit-Change-Number: 18187
Gerrit-PatchSet: 4
Gerrit-Owner: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Attila Bukor <ab...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)

[kudu-CR] [util] optimized version of BitUtil::Ceil()

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

Change subject: [util] optimized version of BitUtil::Ceil()
......................................................................


Patch Set 2: Code-Review+2

Who would've thought the encryption work would lead to Kudu becoming faster :)


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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ia383856aa9a189681f6ee2a0d317476fe3c847bd
Gerrit-Change-Number: 18187
Gerrit-PatchSet: 2
Gerrit-Owner: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Attila Bukor <ab...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Tue, 01 Feb 2022 10:48:17 +0000
Gerrit-HasComments: No

[kudu-CR] [util] optimized version of BitUtil::Ceil()

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

Change subject: [util] optimized version of BitUtil::Ceil()
......................................................................


Patch Set 3: Code-Review+2


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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ia383856aa9a189681f6ee2a0d317476fe3c847bd
Gerrit-Change-Number: 18187
Gerrit-PatchSet: 3
Gerrit-Owner: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Attila Bukor <ab...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Tue, 01 Feb 2022 21:14:12 +0000
Gerrit-HasComments: No

[kudu-CR] [util] optimized version of BitUtil::Ceil()

Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Hello Attila Bukor, Kudu Jenkins, Andrew Wong, 

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

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

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

Change subject: [util] optimized version of BitUtil::Ceil()
......................................................................

[util] optimized version of BitUtil::Ceil()

This patch introduces an optimized version of BitUtil::Ceil() for the
case when the divisor is a power of two.  As it turns out, all usages
of the BitUtil::Ceil() in Kudu are for divisor of 8, so I updated all
the call sites correspondingly.

This patch also contains the updated RLE benchmark.  The comparison
results are the following for a RELEASE configuration built with
c++ (GCC) 8.3.1 20190311 (Red Hat 8.3.1-3)):

Non-optimized implementation:
  Time spent BooleanBitStream: real 0.487s  user 0.486s     sys 0.001s
  Wrote 1048576 bytes

  Time spent BooleanRLE: real 2.302s     user 2.304s      sys 0.001s
  Wrote 46080 bytes

Optimized implementation:
  Time spent BooleanBitStream: real 0.017s  user 0.016s     sys 0.000s
  Wrote 1048576 bytes

  Time spent BooleanRLE: real 2.055s     user 2.056s      sys 0.001s
  Wrote 46080 bytes

As for benmarking direct calls of these functions:
  Time spent BitUtil::Ceil(..., 8): real 0.720s  user 0.721s     sys 0.000s
  Time spent BitUtil::Ceil<3>(...): real 0.402s  user 0.402s     sys 0.000s

Change-Id: Ia383856aa9a189681f6ee2a0d317476fe3c847bd
---
M src/kudu/benchmarks/rle.cc
M src/kudu/util/bit-stream-utils.h
M src/kudu/util/bit-stream-utils.inline.h
M src/kudu/util/bit-util.h
M src/kudu/util/rle-encoding.h
M src/kudu/util/rle-test.cc
6 files changed, 56 insertions(+), 12 deletions(-)


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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ia383856aa9a189681f6ee2a0d317476fe3c847bd
Gerrit-Change-Number: 18187
Gerrit-PatchSet: 2
Gerrit-Owner: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Attila Bukor <ab...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)

[kudu-CR] [util] optimized version of BitUtil::Ceil()

Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Hello Attila Bukor, Kudu Jenkins, Andrew Wong, 

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

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

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

Change subject: [util] optimized version of BitUtil::Ceil()
......................................................................

[util] optimized version of BitUtil::Ceil()

This patch introduces an optimized version of BitUtil::Ceil() for the
case when the divisor is a power of two.  As it turns out, all usages
of the BitUtil::Ceil() in Kudu are for divisor of 8, so I updated all
the call sites correspondingly.

This patch also contains the updated RLE benchmark.  The comparison
results are the following for a RELEASE configuration built with
c++ (GCC) 8.3.1 20190311 (Red Hat 8.3.1-3)):

Non-optimized implementation:
  Time spent BooleanBitStream: real 0.487s  user 0.486s     sys 0.001s
  Wrote 1048576 bytes

  Time spent BooleanRLE: real 2.302s     user 2.304s      sys 0.001s
  Wrote 46080 bytes

Optimized implementation:
  Time spent BooleanBitStream: real 0.017s  user 0.016s     sys 0.000s
  Wrote 1048576 bytes

  Time spent BooleanRLE: real 2.055s     user 2.056s      sys 0.001s
  Wrote 46080 bytes

As for benmarking direct calls of these functions:
  Time spent BitUtil::Ceil(..., 8): real 0.720s  user 0.721s     sys 0.000s
  Time spent BitUtil::Ceil<3>(...): real 0.402s  user 0.402s     sys 0.000s

Change-Id: Ia383856aa9a189681f6ee2a0d317476fe3c847bd
---
M src/kudu/benchmarks/rle.cc
M src/kudu/util/bit-stream-utils.h
M src/kudu/util/bit-stream-utils.inline.h
M src/kudu/util/bit-util.h
M src/kudu/util/rle-encoding.h
M src/kudu/util/rle-test.cc
6 files changed, 55 insertions(+), 12 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/87/18187/3
-- 
To view, visit http://gerrit.cloudera.org:8080/18187
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ia383856aa9a189681f6ee2a0d317476fe3c847bd
Gerrit-Change-Number: 18187
Gerrit-PatchSet: 3
Gerrit-Owner: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Attila Bukor <ab...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)