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

Inline direct calls to enum variant constructors in the frontend #15400

Closed
pcwalton opened this issue Jul 4, 2014 · 0 comments
Closed

Inline direct calls to enum variant constructors in the frontend #15400

pcwalton opened this issue Jul 4, 2014 · 0 comments
Labels
A-codegen Area: Code generation I-compiletime Issue: Problems and improvements with respect to compile times. I-slow Issue: Problems and improvements with respect to performance of generated code.

Comments

@pcwalton
Copy link
Contributor

pcwalton commented Jul 4, 2014

When we see a direct call to an enum variant constructor, we should just inline it in the frontend. This has two important benefits, one obvious and one not-so-obvious: (1) it reduces compilation time; (2) it can often avoid one memcpy, because we can simply write the discriminant and variant payload in place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-codegen Area: Code generation I-compiletime Issue: Problems and improvements with respect to compile times. I-slow Issue: Problems and improvements with respect to performance of generated code.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant