neoremind opened a new pull request #1876: [CALCITE-3878] Make ArrayList 
creation with initial capacity when size is fixed
URL: https://github.com/apache/calcite/pull/1876
 
 
   I find many places in Calcite where `new ArrayList<>()` is used, if the list 
is expected to be immutable or not resizing, it is always a good manner to 
create with initial capacity, better for memory usage and performance.
   
   I search all occurrences, to make it safe, I only update local variables 
with fixed size and not working in recursive method. If the local variable 
reference goes out of scope, if resizing is needed, things will work normally 
as well, so no side effect, but for the "escaping" case, I am very conservative 
and do not change them.

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to