[
https://issues.apache.org/jira/browse/CALCITE-3085?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16850155#comment-16850155
]
Laurent Goujon commented on CALCITE-3085:
-----------------------------------------
It's so useful no subclasses uses it (unlike modCound) :) TBH I don't have the
observation anymore as it was a change one of my team mate made some time
(year) ago, and didn't left much detail except for avoiding the extra
allocation, and also being able to create threadsafe instances of
RelShuttleImpl (and so being able to use singleton).
I also offered a second alternative (see my comment above) to create an
alternative implementation. If people are more comfortable with that second
approach:
- Would people be okay of changing current calcite shuttles to use the
alternative? And replacing instances of RelShuttleImpl with no state by
singleton instances?
- Would people be okay with renaming current RelShuttleImpl
StackingRelShuttleImpl and the alternative RelShuttleImpl
> Unused stack field in RelShuttleImpl
> ------------------------------------
>
> Key: CALCITE-3085
> URL: https://issues.apache.org/jira/browse/CALCITE-3085
> Project: Calcite
> Issue Type: Improvement
> Components: core
> Reporter: Laurent Goujon
> Assignee: Laurent Goujon
> Priority: Minor
> Labels: pull-request-available
> Time Spent: 40m
> Remaining Estimate: 0h
>
> {{RelShuttleImpl}} class has a protected {{stack}} field which is being
> populated when going over children, but those content is actually never used.
> In Calcite code base, no subclasses are actually using the content of the
> stack ({{CorelMapBuilder}} is populating the stack but does not read the
> content back either).
> Searching code on github didn't show any usage of it either (but this is not
> foolprof).
> As maintaining this stack has a non-negligible impact on memory/performance,
> I would suggest to remove the field.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)