Commit 8318940
committed
Adjust the API_REQUEST_LIMIT:
- ### Problem
This limit is used when Bundler fallback to getting a dependency
list from a server `/dependencies?gem=` endpoint. Bundler uses
this API endpoint fallback when a server doesn't expose the compact
index API.
This is not used for Rubygems.org, only private servers.
This limit is then divided by the number of dependency to get
and the result is the number of request we'll be doing.
The bottleneck on the client is the network roundtrip. On the
server, getting the info of 50 or 100 gems is a bit more expensive
but this operation is heavily cached.
This is an example of Rubygems.org implementation at the time the
dependencies API wasn't deprecated
https://github.com/rubygems/rubygems.org/blob/5a3a3ec02acc3a4e3aba077953a393ad20a06842/app/models/gem_dependent.rb#L15
### Context
This limit used to be 100 a while ago but got changed
to 50 in e745f8d
I don't know why.
### Solution
50 gems to query seems arbitrary low. By doubling this number, we
make twice as less API requests which ultimately can shove up to two
seconds on application relying on a large number of gems.1 parent e4fd4ee commit 8318940
File tree
2 files changed
+2
-2
lines changed- bundler
- lib/bundler/source
- spec/bundler/fetcher
2 files changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
212 | 212 | | |
213 | 213 | | |
214 | 214 | | |
215 | | - | |
| 215 | + | |
216 | 216 | | |
217 | 217 | | |
218 | 218 | | |
| |||
0 commit comments