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

perf: Reuse 1Password client #548

Merged
merged 1 commit into from
Oct 16, 2024
Merged

Commits on Oct 16, 2024

  1. perf: Reuse 1Password client

    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 the `client` 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.
    
    Signed-off-by: Will Da Silva <will@willdasilva.xyz>
    WillDaSilva committed Oct 16, 2024
    Configuration menu
    Copy the full SHA
    cf2ff14 View commit details
    Browse the repository at this point in the history