-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Location
crates/gnomon-db/src/eval/interned.rs:50-53
Description
FieldPath::push clones the entire Vec<PathSegment> to produce a new FieldPath:
pub fn push(&self, segment: PathSegment<'db>) -> Self {
let mut segments = self.0.clone();
segments.push(segment);
Self(segments)
}For deeply nested record structures, this results in O(n^2) total allocation where n is the nesting depth, since each level clones all previous segments.
Suggested Fix
Consider using Rc<[PathSegment]> for structural sharing, pre-allocating capacity, or switching to a mutable-push API where the path is built incrementally and rolled back.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request