kou commented on issue #38569:
URL: https://github.com/apache/arrow/issues/38569#issuecomment-1801151626

   Thanks for summarizing the behavior.
   
   String: Are you using 
https://github.com/apache/arrow/pull/38526/files#diff-b440faf74bbde4937a0a476511319f0c1cc255fbf0fb7372277c5f465df7a970R222-R229
 ? If so, a `String()` argument seems wrong:
   
   ```diff
   diff --git a/cpp/src/gandiva/tests/micro_benchmarks.cc 
b/cpp/src/gandiva/tests/micro_benchmarks.cc
   index 4bd4e8d51..88dd5a14c 100644
   --- a/cpp/src/gandiva/tests/micro_benchmarks.cc
   +++ b/cpp/src/gandiva/tests/micro_benchmarks.cc
   @@ -318,7 +318,7 @@ static void TimedTestAllocs(benchmark::State& state) {
      for (int i = 0; i < NUM_BATCHES; i++) {
        for (int col = 0; col < num_fields; col++) {
          arrays[col * NUM_BATCHES + i] =
   -          std::make_shared<ArrayPtr>(rag.String(num_batches, 0, 64, 0));
   +          std::make_shared<ArrayPtr>(rag.String(num_batches, 64, 64, 0));
        }
      }
    
   @@ -351,7 +351,7 @@ static void 
TimedTestOutputStringAllocs(benchmark::State& state) {
      for (int i = 0; i < NUM_BATCHES; i++) {
        for (int col = 0; col < num_fields; col++) {
          arrays[col * NUM_BATCHES + i] =
   -          std::make_shared<ArrayPtr>(rag.String(num_batches, 0, 64, 0));
   +          std::make_shared<ArrayPtr>(rag.String(num_batches, 64, 64, 0));
        }
      }
    
   ```
   
   BTW, why did you compare `AsciiLower`/`AsciiUpper` performance with multiple 
inputs? They are Arrow's compute kernels not Gandiva's functions. We are 
working on Gandiva's benchmark not Arrow's compute kernels, right?
   
   What is the important point in 
`TimedTestAllocs`/`TimedTestOutputStringAllocs`? It seems that it focus on 
memory allocation not `upper` performance because they have `Allocs` in their 
names. If memory allocation performance is the important point and it's not 
increased by the data change, we don't need to care about it.
   
   Decimal: Could you explain more?
   Here is a sample generated array with #38526:
   
   ```diff
   diff --git a/cpp/src/gandiva/tests/micro_benchmarks.cc 
b/cpp/src/gandiva/tests/micro_benchmarks.cc
   index 4bd4e8d51..02aed4c71 100644
   --- a/cpp/src/gandiva/tests/micro_benchmarks.cc
   +++ b/cpp/src/gandiva/tests/micro_benchmarks.cc
   @@ -525,6 +526,7 @@ static void DoDecimalAdd2(benchmark::State& state, 
int32_t precision, int32_t sc
        for (int col = 0; col < num_fields; col++) {
          arrays[col * NUM_BATCHES + i] =
              std::make_shared<ArrayPtr>(rag.Decimal128(decimal_type, 
num_batches, 0, 64, 0));
   +      std::cout << **arrays[col * NUM_BATCHES + i] << std::endl;
        }
      }
    
   ```
   
   ```text
   [
     30767549570.000000002566854084,
     -87923973068817.656751945692017159,
     -91928206713617.619506354929822755,
     60821288362815.346528371379023392,
     -64112645956997.970772781684908311,
     63074099127972.553382781455698009,
     -16941184082774.182190282352712117,
     -67409212744940.964364408478716538,
     -36369925434737.491950329130210850,
     37440631996063.195363909449835822,
     ...
     91737090187668.612368195042828097,
     -83035962690737.078487654169938906,
     -42192441527807.394459688661789590,
     41830067640897.065604367136779604,
     -65275487302948.826419045409244118,
     33681673668716.936339078316272999,
     -9118956089337.854439920962868218,
     -19542009636242.217679573976922312,
     -72636625294767.978416906406436654,
     -40247733243916.629646124384741677
   ]
   ```
   
   It seems that all of these values have different precision. (The 
`000000002566854084` part in `30767549570.000000002566854084` is precision, 
right?)
   


-- 
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.

To unsubscribe, e-mail: [email protected]

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

Reply via email to