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 GetModuleContent performance #148

Merged
merged 1 commit into from
Mar 26, 2022
Merged

Conversation

wata727
Copy link
Member

@wata727 wata727 commented Mar 26, 2022

This PR introduces two optimizations for GetModuleContent API.

One is a hint phrase as an option. If you are extracting content based on a schema, you should extract all resources, even if you are inspecting for a particular resource. This is obviously inefficient. The hint phrase can be used to determine whether the resource exists at an early stage.

The other is to change the return value of GetFiles. The server returns map[string]*hcl.File, just like the client. This is inefficient if you have a large number of files, as it requires a step to convert to bytes. For this reason, this PR changes the server to return map[string][]byte.

@wata727 wata727 merged commit 1d4544f into master Mar 26, 2022
@wata727 wata727 deleted the get_module_content_hint branch March 26, 2022 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant