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

   Can we improve performance by the following like the change in 
https://bugs.llvm.org/show_bug.cgi?id=16747#c2 ?
   
   ```diff
   diff --git a/cpp/src/arrow/type.cc b/cpp/src/arrow/type.cc
   index cba4a0ecd3..8959655aea 100644
   --- a/cpp/src/arrow/type.cc
   +++ b/cpp/src/arrow/type.cc
   @@ -1331,7 +1331,8 @@ namespace {
    
    std::unordered_multimap<std::string_view, int> CreateNameToIndexMap(
        const FieldVector& fields) {
   -  std::unordered_multimap<std::string_view, int> name_to_index;
   +  std::unordered_multimap<std::string_view, int> 
name_to_index(fields.size());
   +  name_to_index.max_load_factor(std::numeric_limits<float>::infinity());
      for (size_t i = 0; i < fields.size(); ++i) {
        name_to_index.emplace(fields[i]->name(), static_cast<int>(i));
      }
   ```


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