Skip to content

Reduce allocation churn in tree rewriting #21751

@neilconway

Description

@neilconway

Is your feature request related to a problem or challenge?

The logical query optimizer does a fair bit of allocation. After profiling, two similar hotspots are in TreeNodeContainer: map_elements takes a closure, unboxes the inner value, invokes the closure, and then re-boxes the value in a fresh Box. It would be more efficient to just reuse the Box. Similarly for the Arc variant, as long as the Arc is unique.

Describe the solution you'd like

No response

Describe alternatives you've considered

No response

Additional context

No response

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request
No fields configured for Feature.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions