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

Optimize allocation for node dependencies and observers in compiler #12851

Open
straight-shoota opened this issue Dec 17, 2022 · 0 comments · May be fixed by #15098
Open

Optimize allocation for node dependencies and observers in compiler #12851

straight-shoota opened this issue Dec 17, 2022 · 0 comments · May be fixed by #15098

Comments

@straight-shoota
Copy link
Member

Most of the time, dependencies and observers arrays only have one element. Allocating an array for a single element is inefficient and can be optimized.

This was originally implemented in #12405 changing the type from Array(ASTNode) | Nil to a union Array(ASTNode) | ASTNode | Nil where single elements are represented as ASTNode directly.
But that broke the interpreter (#12769), so it was reverted in #12849.

This optimization probably still makes sense, but we need to figure out what's breaking and fix that.

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

Successfully merging a pull request may close this issue.

1 participant