Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I noticed that the 1Password providers were very slow, and the amount of time it took to evaluate a YAML file with 1Password references increased approximately linearly with the number of 1Password references, which suggested to me that work was being unnecessarily repeated.
I found that the providers have a
client
field, and its assigned to, but we never check if its set, so we always create a new client. This PR updates the providers so that if theclient
is not set one will be created, and if one has been set then it'll be reused.For my YAML file with 26 1Password references, this change reduced the time it took to evaluate the file from 29 seconds to 11 seconds. There is still room for improvement (e.g. by parallelizing the evaluation of each ref, improved caching, etc.), but this seems like a simple and worthwhile change on its own.