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

Avoid unnecessary memory allocations in decodeMapFromStruct #188

Merged
merged 1 commit into from May 1, 2020

Conversation

jsamunderu
Copy link
Contributor

Splits allocates memory. This burdens the garbage collector.
By using string.Index to parse string you will be more cache
aware and do not create gabbage.

@mitchellh Can you please review and merge if good enough.

Splits allocates memory. This burdens the garbage collector.
By using string.Index to parse string you will be more cache
aware and do not create gabbage.
@mitchellh
Copy link
Owner

Thanks this seems good to me. It always bothered me that we have to range over those.

Realistically from a performance perspective my guess is that this doesn't matter, since reflect in general is very slow. So unless we're doing something really dumb, no optimizations will overcome that most likely.

@mitchellh mitchellh merged commit 14428cd into mitchellh:master May 1, 2020
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

Successfully merging this pull request may close these issues.

None yet

2 participants