HuaHuaY commented on code in PR #2461:
URL: https://github.com/apache/orc/pull/2461#discussion_r2610774119


##########
c++/src/ColumnWriter.cc:
##########
@@ -1038,6 +1038,8 @@ namespace orc {
 
     if (!useDictionary) {
       directLengthEncoder->add(length, numValues, notNull);
+    } else if (dictionary.capacity() < numValues) {

Review Comment:
   I think this can solve the expansion overhead at startup at a small cost. 
Usually the map does not reserve a large value immediately, but gradually 
expands it by a multiple of the size. When the map is very large, calling 
reserve to allocate memory for each insertion will take more time, so a 
condition is used here to determine.



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