-
Notifications
You must be signed in to change notification settings - Fork 989
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
Keep sessions around between each ConanRequester #17455
Keep sessions around between each ConanRequester #17455
Conversation
Avoid creating a new session for each ConanRequester instance, this helps a lot with performance, as it avoids the overhead duplicate handshakes
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.
This looks much better than the previous approach
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.
Wow! This looks amazing! Great job @AbrilRBS !!
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.
Looking very good!
@@ -31,6 +32,8 @@ def __init__(self, conan_api): | |||
self.conan_api = conan_api | |||
self._home_folder = conan_api.home_folder | |||
self._remotes_file = HomePaths(self._home_folder).remotes_path | |||
# Wraps an http_requester to inject proxies, certs, etc | |||
self._requester = ConanRequester(self.conan_api.config.global_conf, self.conan_api.cache_folder) |
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.
We need to design, implement and document properly the "invalidating" and reloading of global.conf, like the requester will not get new conf after a config install
. I think this is perfectly good as default, but the "invalidation" should also be doable and documented. I'll create a ticket for this later.
self._url_creds = _SourceURLCredentials(cache_folder) | ||
self._max_retries = config.get("core.net.http:max_retries", default=2, check_type=int) |
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.
The _max_retries
is now legacy?
After internal testing on Conan Center Index, this has reduced some cases of build-order calculations from 45 mins to 10. |
Changelog: Feature: Cache HTTP request sessions between API calls
Docs: Omit
Avoid creating a new session for each ConanRequester instance, this helps a lot with performance, as it avoids the overhead duplicate handshakes
I get an additional 40% speedup on top of #17449