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

Reduce init time allocation when declaring types used for reflect #821

Merged
merged 1 commit into from Oct 7, 2022

Conversation

dolmen
Copy link
Contributor

@dolmen dolmen commented Oct 4, 2022

In declaration of types used for reflect, use reflect.TypeOf((*T)).Elem() instead of reflect.TypeOf(T{}) to avoid init-time allocations.

See related stdlib issue: golang/go#55973

In declaration of types used for reflect, use
reflect.TypeOf((*T)).Elem() instead of reflect.TypeOf(T{}) to avoid
init-time allocations.

See related stdlib issue: golang/go#55973
@dolmen
Copy link
Contributor Author

dolmen commented Oct 4, 2022

Blocked on my side by dolmen/github-keygen#47 as I have to sign my commits.

@pelletier pelletier added the performance Issue related to a performance problem or pull request improving performance. label Oct 7, 2022
@pelletier pelletier merged commit d268873 into pelletier:v2 Oct 7, 2022
@pelletier
Copy link
Owner

No worries for signed commits. Merged it, thanks a lot for the patch!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Issue related to a performance problem or pull request improving performance.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants