You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by GitBox <gi...@apache.org> on 2020/03/26 10:10:34 UTC
[GitHub] [calcite] neoremind opened a new pull request #1876: [CALCITE-3878]
Make ArrayList creation with initial capacity when size is fixed
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:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [calcite] neoremind commented on issue #1876: [CALCITE-3878] Make
ArrayList creation with initial capacity when size is fixed
Posted by GitBox <gi...@apache.org>.
neoremind commented on issue #1876: [CALCITE-3878] Make ArrayList creation with initial capacity when size is fixed
URL: https://github.com/apache/calcite/pull/1876#issuecomment-604806498
@chunweilei Thanks for reminding as well. I have replied Julian in JIRA.
----------------------------------------------------------------
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:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [calcite] julianhyde commented on issue #1876: [CALCITE-3878] Make
ArrayList creation with initial capacity when size is fixed
Posted by GitBox <gi...@apache.org>.
julianhyde commented on issue #1876: [CALCITE-3878] Make ArrayList creation with initial capacity when size is fixed
URL: https://github.com/apache/calcite/pull/1876#issuecomment-605146615
-1
----------------------------------------------------------------
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:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [calcite] vlsi commented on issue #1876: [CALCITE-3878] Make
ArrayList creation with initial capacity when size is fixed
Posted by GitBox <gi...@apache.org>.
vlsi commented on issue #1876: [CALCITE-3878] Make ArrayList creation with initial capacity when size is fixed
URL: https://github.com/apache/calcite/pull/1876#issuecomment-605148353
why -1 ?
----------------------------------------------------------------
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:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [calcite] vlsi commented on issue #1876: [CALCITE-3878] Make
ArrayList creation with initial capacity when size is fixed
Posted by GitBox <gi...@apache.org>.
vlsi commented on issue #1876: [CALCITE-3878] Make ArrayList creation with initial capacity when size is fixed
URL: https://github.com/apache/calcite/pull/1876#issuecomment-604344052
LGTM
----------------------------------------------------------------
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:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [calcite] hsyuan commented on issue #1876: [CALCITE-3878] Make
ArrayList creation with initial capacity when size is fixed
Posted by GitBox <gi...@apache.org>.
hsyuan commented on issue #1876: [CALCITE-3878] Make ArrayList creation with initial capacity when size is fixed
URL: https://github.com/apache/calcite/pull/1876#issuecomment-604794008
I didn't notice it. Thanks for reminding.
----------------------------------------------------------------
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:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [calcite] julianhyde commented on issue #1876: [CALCITE-3878] Make
ArrayList creation with initial capacity when size is fixed
Posted by GitBox <gi...@apache.org>.
julianhyde commented on issue #1876: [CALCITE-3878] Make ArrayList creation with initial capacity when size is fixed
URL: https://github.com/apache/calcite/pull/1876#issuecomment-605157488
I was duplicating the -1 in the jira case, in case people missed it. Read JIRA for my rationale.
----------------------------------------------------------------
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:
users@infra.apache.org
With regards,
Apache Git Services