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

Increase performance with a generated function #1

Open
LilithHafner opened this issue Sep 24, 2024 · 2 comments
Open

Increase performance with a generated function #1

LilithHafner opened this issue Sep 24, 2024 · 2 comments

Comments

@LilithHafner
Copy link

In the case where the type is available at macro expansion time, it should be possible to provide a high performance macro that does introspection at macro expansion time and only trivial operations at runtime.

@aplavin
Copy link
Member

aplavin commented Sep 24, 2024

Hmm, not sure how to do it as a macro... A generated function definitely seems possible though.

@LilithHafner
Copy link
Author

Ah, right. A generated function is the right answer here. A macro would be at macro-expansion time instead of compile time, but that is less flexible.

To do it as a macro the type would need to be a literal type and then the macro would determine what that literal refers to, but that would be a hacky and bad solution in comparison to a generated function.

@LilithHafner LilithHafner changed the title Add high performance macro Increase performance with a generated function Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants