claudeyj commented on code in PR #10445:
URL: https://github.com/apache/pinot/pull/10445#discussion_r1141639727


##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/creator/impl/SegmentIndexCreationDriverImpl.java:
##########
@@ -175,7 +175,7 @@ public void init(SegmentGeneratorConfig config, 
SegmentCreationDataSource dataSo
 
     // Initialize index creation
     _segmentIndexCreationInfo = new SegmentIndexCreationInfo();
-    _indexCreationInfoMap = new HashMap<>();
+    _indexCreationInfoMap = new LinkedHashMap<>();

Review Comment:
   I think you refer to the cost of `Map.put(key, value)` (the index creation), 
so I run some simple profiling experiments in my machine. I just iterate for 
many times and invoke the `put` method. It shows that with iterations ranging 
from 1000 to 10,000,000, the time consumption for HashMap and LinkedHashMap is 
respecitively (1ms, 1ms), (4ms, 5ms), (33ms, 17ms), (138ms, 115ms), (1647ms, 
3006ms), (114668ms, 33698ms). You can see the performance difference is quite 
related to number of iterations. In this case the key of two maps affected is 
`columnName` and I'm not sure about the normal number of columns in realistic 
scenario but hope this can help you do the trade off.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to