-
-
Notifications
You must be signed in to change notification settings - Fork 0
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
fix(autofix): Cache repo client objects to avoid re-initialization #1626
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
Callout from Ram: is the RepoClient holding open any connections? If so, that would be a problem. However, I think it's not doing that. It's just wrapping HTTP requests. But @jennmueng can you confirm? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice find! functools.cache
might be a simpler solution. Also, yeah it should just be http requests from the github client!
See this profile.
We were creating new repo clients over and over again, and each time, it added 1-1.5s.
This PR stores created repo clients in memory in the context so that throughout a single step, we only need to initialize one repo client for each repo.