-
Notifications
You must be signed in to change notification settings - Fork 163
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
The project is still crating many gcs clients #626
Comments
maybe it's easier to create a property and a lazily initialzed |
Why is this a problem? AFAIK GCS Client is just a bundle of configuration parameters to make API calls (but feel free to correct me). Is this a big performance hit? |
as far as i know every storage client maintains its http client which is a request session so it will not reuse connections |
I don't understand what this means exactly. I have two issues here:
|
Did a dirty performance check and it seems that it does have an impact. I think what @lkuligin means is:
This limits the client creation to one per |
After i fixed: ef44612
I suddenly saw that ImageBytesLoader is created ad hoc in every function. So the commit mentioned is just a first step to fix this issue.
Look please here: https://github.com/search?q=repo%3Alangchain-ai%2Flangchain-google%20ImageBytesLoader&type=code
What do you suggest here?
The path which i hit is at
langchain-google/libs/vertexai/langchain_google_vertexai/chat_models.py
Line 221 in 7f704aa
I see one possible solution which is creating a cache of imagebytsloader. for xample creating a map from project to imagbytesloader (lru_cache) . But this is a bigger change and want to hear what you think.
The text was updated successfully, but these errors were encountered: