MingyuZhong commented on a change in pull request #8542:
URL: https://github.com/apache/arrow/pull/8542#discussion_r516330879



##########
File path: cpp/src/arrow/util/decimal_benchmark.cc
##########
@@ -158,6 +158,7 @@ static void BinaryMathOp256(benchmark::State& state) {  // 
NOLINT non-const refe
   for (auto _ : state) {
     for (int x = 0; x < kValueSize; x += 5) {
       benchmark::DoNotOptimize(v1[x + 2] * v2[x + 2]);
+      benchmark::DoNotOptimize(v1[x + 3] / v2[x + 3]);

Review comment:
       Can you find the functions that are called only once (e.g., 
DecimalDivide), make them inline and run the benchmarks again?

##########
File path: cpp/src/arrow/util/basic_decimal.cc
##########
@@ -575,8 +572,7 @@ template <class DecimalClass>
 static DecimalStatus DecimalDivide(const DecimalClass& dividend,
                                    const DecimalClass& divisor, DecimalClass* 
result,
                                    DecimalClass* remainder) {
-  static int64_t kDecimalArrayLength =
-      std::is_same<DecimalClass, BasicDecimal128>::value ? 4 : 8;
+  static constexpr int64_t kDecimalArrayLength = sizeof(DecimalClass) / 
sizeof(uint32_t);

Review comment:
       I don't think you need "static" here.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to