Todd Lipcon has submitted this change and it was merged. ( 
http://gerrit.cloudera.org:8080/15549 )

Change subject: Use popcnt instruction for Bits::Count
......................................................................

Use popcnt instruction for Bits::Count

I found Bits::Count to be a noticeable contributor to profiles in my
TSDB benchmarking (a couple percent, if I recall correctly). This
switches to using popcnt instead of a lookup table.

This is technically a new CPU requirement, since the popcnt flag is
separate from the SSE4.2 flag. In practice, however, it doesn't appear
that there are any SSE4.2-capable machines that aren't also capable of
POPCNT. So, this shouldn't actually change our hardware requirements.
Another bit of evidence here is that '-msse4.2' (which we use) in clang
also enables -mpopcnt by default, so it was already possible for clang
to emit popcnt instructions for its own optimizations.

In any case, this instruction was introduced about 10 years ago, so even
if I missed one case of a 2010-era server, it's unlikely to still be in
use for Kudu.

Change-Id: Iad045e8b77e7baf65c42366eea3e107900eb4a64
Reviewed-on: http://gerrit.cloudera.org:8080/15549
Reviewed-by: Bankim Bhavsar <ban...@cloudera.com>
Reviewed-by: Andrew Wong <aw...@cloudera.com>
Tested-by: Andrew Wong <aw...@cloudera.com>
---
M src/kudu/gutil/bits.cc
M src/kudu/gutil/cpu.cc
M src/kudu/gutil/cpu.h
M src/kudu/util/init.cc
4 files changed, 30 insertions(+), 2 deletions(-)

Approvals:
  Bankim Bhavsar: Looks good to me, but someone else must approve
  Andrew Wong: Looks good to me, approved; Verified

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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Iad045e8b77e7baf65c42366eea3e107900eb4a64
Gerrit-Change-Number: 15549
Gerrit-PatchSet: 3
Gerrit-Owner: Todd Lipcon <t...@apache.org>
Gerrit-Reviewer: Andrew Wong <andrew.w...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Bankim Bhavsar <ban...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Todd Lipcon <t...@apache.org>

Reply via email to