[jira] [Commented] (CALCITE-2778) CompoundClosableAllocation Prefer ArrayList

2019-01-08 Thread Julian Hyde (JIRA)


[ 
https://issues.apache.org/jira/browse/CALCITE-2778?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16737481#comment-16737481
 ] 

Julian Hyde commented on CALCITE-2778:
--

Are you experiencing performance issues due to this class? (It's no longer used 
in Calcite, so I would be surprised.)

Your fix removes the "set null" which, as the comment explained, is important 
to prevent cycles.

> CompoundClosableAllocation Prefer ArrayList
> ---
>
> Key: CALCITE-2778
> URL: https://issues.apache.org/jira/browse/CALCITE-2778
> Project: Calcite
>  Issue Type: Improvement
>  Components: core
>Reporter: BELUGA BEHR
>Assignee: Julian Hyde
>Priority: Minor
>
> In Java, ArrayList should be the default choice over LinkedList.  It 
> generally requires less memory and is faster.  Update 
> {{CompoundClosableAllocation}} to use an Array structure instead of linked 
> list and simplify the code.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (CALCITE-2778) CompoundClosableAllocation Prefer ArrayList

2019-01-08 Thread BELUGA BEHR (JIRA)


[ 
https://issues.apache.org/jira/browse/CALCITE-2778?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16737485#comment-16737485
 ] 

BELUGA BEHR commented on CALCITE-2778:
--

[~julianhyde] Ha.  Interesting that it's not even used.  May I simply remove it?

I am interested in the Calcite project and just starting to look it over a 
little bit as a n00b.  I just popped open a few files to check things out and 
noticed that this class is a bit cumbersome and could be tightened up (less is 
more).

In regards to the 'set null'.  The call to {{removeLast()}}  simply removes the 
item from the collection so that it is no longer discover-able, instead of 
{{clear()}} the list at the end.  If concurrency is a real problem, then it 
would be best to synchronize the calls and protect the collection.  Though, all 
of this is moot if it's not even used anymore.

> CompoundClosableAllocation Prefer ArrayList
> ---
>
> Key: CALCITE-2778
> URL: https://issues.apache.org/jira/browse/CALCITE-2778
> Project: Calcite
>  Issue Type: Improvement
>  Components: core
>Reporter: BELUGA BEHR
>Assignee: Julian Hyde
>Priority: Minor
>
> In Java, ArrayList should be the default choice over LinkedList.  It 
> generally requires less memory and is faster.  Update 
> {{CompoundClosableAllocation}} to use an Array structure instead of linked 
> list and simplify the code.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (CALCITE-2778) CompoundClosableAllocation Prefer ArrayList

2019-01-08 Thread BELUGA BEHR (JIRA)


[ 
https://issues.apache.org/jira/browse/CALCITE-2778?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16737455#comment-16737455
 ] 

BELUGA BEHR commented on CALCITE-2778:
--

https://github.com/apache/calcite/pull/994

> CompoundClosableAllocation Prefer ArrayList
> ---
>
> Key: CALCITE-2778
> URL: https://issues.apache.org/jira/browse/CALCITE-2778
> Project: Calcite
>  Issue Type: Improvement
>  Components: core
>Reporter: BELUGA BEHR
>Assignee: Julian Hyde
>Priority: Minor
>
> In Java, ArrayList should be the default choice over LinkedList.  It 
> generally requires less memory and is faster.  Update 
> {{CompoundClosableAllocation}} to use an Array structure instead of linked 
> list and simplify the code.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)