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

Reuse session in rest requests #14795

Merged
merged 4 commits into from
Sep 21, 2023

Conversation

hackenbergstefan
Copy link
Contributor

@hackenbergstefan hackenbergstefan commented Sep 21, 2023

Changelog: BugFix: Reuse session in ConanRequester to speed up requests.
Docs: omit

fixes #14794

@CLAassistant
Copy link

CLAassistant commented Sep 21, 2023

CLA assistant check
All committers have signed the CLA.

@memsharded
Copy link
Member

Hi @hackenbergstefan

Thanks for your contribution.
If this is to be considered for 2.0.X releases, please target the release/2.0 branch in your PR.

It seems that the change broke some integrations tests that have some mocking, if you can please try to have a look, and if it makes sense to fix the mocking for the tests to pass, or something else is happening. If not, don't worry, we can try to have a look ourselves.

I am curious, how did you get that deep into the Conan code to realize this? What effects were you seeing, like slower than expected http calls?

@memsharded memsharded added this to the 2.0.12 milestone Sep 21, 2023
@hackenbergstefan
Copy link
Contributor Author

Hey!
First of all, thank's for the quick reply! 👍

I am curious, how did you get that deep into the Conan code to realize this? What effects were you seeing, like slower than expected http calls?

I'm currently using Conan 1 migrating to Conan 2. During this migration I realized that Conan 2 was much slower. This disappointed me and my colleagues and so I started digging into ;-)

@hackenbergstefan
Copy link
Contributor Author

Thanks for your contribution. If this is to be considered for 2.0.X releases, please target the release/2.0 branch in your PR.

Should I open two PRs? One for develop2 and one for release/2.0?

@memsharded
Copy link
Member

Interesting! That much slower than caching the session really makes a big difference?
Besides some slowness introduced by the compatibility checks of cppstd Conan 2.0 shouldn't be slower than 1.X (and of course besides this possible bug). The cppstd thing it is in our todo-list.

If this bugfix improves noticeable the speed, that would be great, thanks again for looking into this!

@memsharded
Copy link
Member

Should I open two PRs? One for develop2 and one for release/2.0?

Not necessary, we merge release/2.0->develop2 regularly.

@hackenbergstefan
Copy link
Contributor Author

If this bugfix improves noticeable the speed, that would be great, thanks again for looking into this!

On my client and infrastructure I had these differences:

  • Conan 1 (Session): 0.4-0.1ms per ConanRequester._call_method
  • Conan 2 (no Session): 100-300ms per ConanRequester._call_method

@hackenbergstefan hackenbergstefan changed the base branch from develop2 to release/2.0 September 21, 2023 12:27
@AbrilRBS
Copy link
Member

This is great! Thanks a lot for going above and beyond and investigating the root cause of the slowdown :)

@hackenbergstefan
Copy link
Contributor Author

This is great! Thanks a lot for going above and beyond and investigating the root cause of the slowdown :)

Sure! This is how Open-Source should work in my opinion ;-)

Copy link
Member

@AbrilRBS AbrilRBS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seeing a (subjective) improvement in compatibility resolution with this change too, linking #14799 to not lose track of improvements on that area

@memsharded memsharded self-assigned this Sep 21, 2023
@memsharded memsharded merged commit 6f9613b into conan-io:release/2.0 Sep 21, 2023
@memsharded
Copy link
Member

Amazing. Installing some large graph (only recipes + package_id computation), reduced from 22 seconds to 11 seconds.

Thanks again for contributing this! It will be in next 2.0.12

@hackenbergstefan hackenbergstefan deleted the feature/fixrequests branch September 22, 2023 07:12
@SpaceIm
Copy link
Contributor

SpaceIm commented Sep 28, 2023

Thanks a lot, it's way way way faster when conan checks new RREV, PREV and compatible packages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[bug] Session is not reused in ConanRequester
6 participants