You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@impala.apache.org by "Quanlong Huang (Jira)" <ji...@apache.org> on 2023/02/12 00:46:00 UTC

[jira] [Created] (IMPALA-11916) base::IsAarch64 should be inlined

Quanlong Huang created IMPALA-11916:
---------------------------------------

             Summary: base::IsAarch64 should be inlined
                 Key: IMPALA-11916
                 URL: https://issues.apache.org/jira/browse/IMPALA-11916
             Project: IMPALA
          Issue Type: Improvement
          Components: Backend
            Reporter: Quanlong Huang
            Assignee: Quanlong Huang


In a perf test, I see base::IsAarch64() show up:
{noformat}
Overhead  Shared Object                    Symbol
  27.20%  impalad                         [.] kudu::BlockBloomFilter::BucketFindAVX2
  22.78%  impalad                         [.] snappy::RawUncompress
   2.90%  impalad                         [.] kudu::BlockBloomFilter::Find
   2.86%  impalad                         [.] impala::BitPacking::UnpackAndDecodeValues<impala::StringValue>
   2.79%  [kernel]                        [k] 0xffffffffb51b507e
   2.44%  impalad                         [.] impala::BitPacking::UnpackAndDecode32Values<impala::StringValue, 3>
   2.26%  impalad                         [.] impala::ScalarColumnReader<long, (parquet::Type::type)2, true>::ReadSlotsNoConversion
   1.72%  impalad                         [.] impala::BitPacking::UnpackAndDecode32Values<impala::DecimalValue<long>, 6>
   1.71%  libc-2.27.so                    [.] __memset_avx2_erms
   1.70%  impalad                         [.] impala::ScalarColumnReader<impala::StringValue, (parquet::Type::type)6, true>::ReadSlotsNoConversion
   1.61%  libhadoop.so.1.0.0              [.] pipelined_crc32c
   0.65%  [kernel]                        [k] 0xffffffffb51cedf7
   0.57%  impalad                         [.] impala::ScalarColumnReader<impala::DecimalValue<long>, (parquet::Type::type)7, true>::ReadSlotsNoConversion
   0.47%  libc-2.27.so                    [.] __memcpy_avx_unaligned_erms
   0.43%  [kernel]                        [k] 0xffffffffb49db710
   0.41%  impalad                         [.] base::IsAarch64
   0.32%  impalad                         [.] impala::HdfsParquetScanner::AssembleRows<false>
   0.28%  impalad                         [.] impala::RleBatchDecoder<unsigned int>::DecodeLiteralValues<impala::DecimalValue<long> >
   0.27%  libc-2.27.so                    [.] __memcmp_avx2_movbe
   0.25%  impalad                         [.] impala::HdfsParquetScanner::FillScratchMicroBatches
   0.18%  impalad                         [.] impala::BitPacking::UnpackAndDecodeValues<impala::DecimalValue<long> >
   0.16%  impalad                         [.] free
{noformat}
It just simply returns true for ARM and false for X86 so should be inlined:
{code:cpp}
bool IsAarch64(void) {
#ifdef __aarch64__
  return true;
#else
  return false;
#endif
}
{code}
Note that the hot path that uses it is in HashUtil::Hash() (be/src/util/hash-util.h):
{code:cpp}
  static uint32_t Hash(const void* data, int32_t bytes, uint32_t seed) {
    if (base::IsAarch64() || LIKELY(CpuInfo::IsSupported(CpuInfo::SSE4_2))) {
      return CrcHash(data, bytes, seed);
    } else {
      return MurmurHash2_64(data, bytes, seed);
    }   
  }
{code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)