impala-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tim Armstrong (Code Review)" <>
Subject [Impala-CR](cdh5-trunk) Use more efficient gutil implementation of Log2Ceiling
Date Mon, 11 Apr 2016 21:21:24 GMT
Hello Dan Hecht,

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

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

Change subject: Use more efficient gutil implementation of Log2Ceiling

Use more efficient gutil implementation of Log2Ceiling

This was used in FreePool::Allocate, which is called a lot in some
workloads, so may have some perf impact. I was looking at using this
function for an allocator for the new buffer pool and it makes the
allocator code simpler if I can call this function freely without
perf concerns.

Modified gutil's implementation slightly so that gcc optimises it to
the following branch-free code:

        .align 2
        .p2align 4,,15
        .globl  _ZN4Bits20Log2CeilingNonZero64Ey
        .type   _ZN4Bits20Log2CeilingNonZero64Ey, @function
        .loc 1 90 0
        .loc 1 92 0
        leaq    -1(%rdi), %rdx  #, D.40305
        .loc 2 155 0
        bsrq    %rdi, %rax      # n, tmp89
        .loc 1 92 0
        andq    %rdx, %rdi      # D.40305, D.40305
        .loc 1 95 0
        cmpq    $1, %rdi        #, D.40305
        sbbl    $-1, %eax       #, D.40304
        .loc 1 96 0

Change-Id: Ifbffb49b5c86394e5a9ccd711132543856321be0
M be/src/exec/
M be/src/gutil/
M be/src/gutil/bits.h
M be/src/runtime/
M be/src/runtime/free-pool.h
M be/src/runtime/
M be/src/util/
M be/src/util/bit-util.h
M be/src/util/bloom-filter.h
M be/src/util/dict-encoding.h
10 files changed, 65 insertions(+), 55 deletions(-)

  git pull ssh:// refs/changes/35/2735/2
To view, visit
To unsubscribe, visit

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ifbffb49b5c86394e5a9ccd711132543856321be0
Gerrit-PatchSet: 2
Gerrit-Project: Impala
Gerrit-Branch: cdh5-trunk
Gerrit-Owner: Tim Armstrong <>
Gerrit-Reviewer: Dan Hecht <>
Gerrit-Reviewer: Skye Wanderman-Milne <>

View raw message