Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider removing #parent from various Stupidedi::Schema #169

Open
kputnam opened this issue Jan 13, 2019 · 0 comments
Open

Consider removing #parent from various Stupidedi::Schema #169

kputnam opened this issue Jan 13, 2019 · 0 comments
Labels

Comments

@kputnam
Copy link
Owner

kputnam commented Jan 13, 2019

Because nearly every definition has a #parent, simple elements that are the "leaves" of a tree are copied quite a lot. Specifically, once a SimpleElementDef becomes part of a SegmentDef, it's copied and potentially copied again when the SegmentDef is added to a grammar.

I'm not sure where the parents of various schema definitions are actually used, or if those uses are truly necessary. While I don't yet have memory profiler data, copying around a lot of SimpleElementDef and friends isn't free. It might be beneficial to remove #parent.

Note that #parent is not implemented on Stupidedi::Values because parents are tracked by using Stupidedi::Zipper, leaving the actual node unchanged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant