rubygems/rubygems — pull request #871 by matthewd (2014-03-29 00:03:37+00:00)
Title: Defer API prefetch until it's required

In normal operation, after we get the first level dependencies, we'll
make several prefetch calls before we need one of those results. Waiting
until then means we can make fewer HTTP requests.

Before:
```
delta:src/rubygems[master]% time ruby -I lib bin/gem install rails --no-ri --no-rdoc
Successfully installed rails-4.0.4
1 gem installed
ruby -I lib bin/gem install rails --no-ri --no-rdoc 0.98s user 0.18s system 5% cpu 21.170 total
```

After:
```
delta:src/rubygems[defer_fetch]% time ruby -I lib bin/gem install rails --no-ri --no-rdoc
Successfully installed rails-4.0.4
1 gem installed
ruby -I lib bin/gem install rails --no-ri --no-rdoc 0.83s user 0.17s system 10% cpu 9.732 total
```

When applied on top of #869, this only gives a more modest 30% improvement:

master + #869:
```
delta:src/rubygems[persistent]% time ruby -I lib bin/gem install rails --no-ri --no-rdoc
Successfully installed rails-4.0.4
1 gem installed
ruby -I lib bin/gem install rails --no-ri --no-rdoc 0.75s user 0.17s system 12% cpu 7.612 total
```

master + #869 + defer_fetch:
```
delta:src/rubygems[combined]% time ruby -I lib bin/gem install rails --no-ri --no-rdoc
Successfully installed rails-4.0.4
1 gem installed
ruby -I lib bin/gem install rails --no-ri --no-rdoc 0.75s user 0.17s system 17% cpu 5.288 total
```