Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
1.22.0
Description
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, focus on the core module, 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.
Attachments
Issue Links
- links to