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

Remove one fallback to full indexes on big gemfiles #6578

Merged

Conversation

deivid-rodriguez
Copy link
Member

@deivid-rodriguez deivid-rodriguez commented Apr 4, 2023

What was the end-user or developer problem that led to this PR?

If Gemfile has a lot of dependencies, we have an optimization that uses the full index in that case, assuming it's going to be faster.

I think this is an old optimization that predates compact index API times, I believe we no longer need it these days.

Also, since a few releases ago we check for circular dependencies when resolving by looping through all versions of each name and removing those that have circular dependencies that would trip up the resolver.

This loop becomes actually very slow when full indexes are used because to find dependencies of a gemspec, we need to explicitly fetch the marshaled gemspec (gemspec.rz endpoint) for it, so the optimization has the opposite effect of making things very slow.

What is your fix for the problem, implemented in this PR?

Consistently use dependency APIs without special casing Gemfiles with a lot of dependencies.

Make sure the following tasks are checked

@deivid-rodriguez deivid-rodriguez force-pushed the remove-full-index-fallback-on-big-gemfiles branch 4 times, most recently from 653cef0 to 438b636 Compare April 5, 2023 11:40
If Gemfile has a lot of dependencies, we have an optimization that uses
the full index in that case, assuming it's going to be faster.

I think this is an old optimization that predates compact index API
times, I believe we no longer need it these days.

Also, since a few releases ago we check for circular dependencies when
resolving by looping through all versions of each name and removing
those that have circular dependencies that would trip up the resolver.

This loop becomes actually very slow when full indexes are used because
to find dependencies of a gemspec, we need to explicitly fetch the
marshaled gemspec (`gemspec.rz` endpoint) for it, so the optimization
has the opposite effect of making things very slow.
@deivid-rodriguez deivid-rodriguez force-pushed the remove-full-index-fallback-on-big-gemfiles branch from 438b636 to 2f46289 Compare April 7, 2023 11:47
@deivid-rodriguez deivid-rodriguez merged commit 560e37f into master Apr 7, 2023
92 checks passed
@deivid-rodriguez deivid-rodriguez deleted the remove-full-index-fallback-on-big-gemfiles branch April 7, 2023 13:52
@stanhu
Copy link
Contributor

stanhu commented Apr 9, 2023

Thanks for this! I was just investigating why our bundle install invocations were taking so long and saw that we had exceeded the 500 gems. When I bumped up API_REQUEST_LIMIT to 1000, I didn't see any issues.

Would you be the right person to release an update for this?

deivid-rodriguez added a commit that referenced this pull request Apr 10, 2023
…big-gemfiles

Remove one fallback to full indexes on big gemfiles

(cherry picked from commit 560e37f)
@deivid-rodriguez
Copy link
Member Author

Currently preparing releases 👍.

@stanhu
Copy link
Contributor

stanhu commented Apr 12, 2023

Thank you!

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

Successfully merging this pull request may close these issues.

None yet

2 participants