Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
4.0.0
Description
By default, the TreeNode `treePatternBits` and `ineffectiveRules` variables are initialized to a `BitSet`, which takes up memory even when empty. For plans with a high number of TreeNodes, this adds unnecessary memory pressure, especially for large expression trees. Reduce the memory pressure by lazily initializing this variable.
For `treePatternBits` we will observe no benefit because these are always populated. However, for `ineffectiveRules` it is not necessary to initialize this for every node. We should make this variable lazy, being careful to not initialize even when `get` is called.
Related to SPARK-48047.
Attachments
Issue Links
- links to