News for hackers. Stuff that matters.
Re:Why Bundler 1.1 will be much faster by spicyj on Monday October 17, 2011 @10:05AM (#3120501)
Is there a reason rubygems.org can't return all of the dependencies, instead of one layer at a time?
Re:Why Bundler 1.1 will be much faster by pat_shaughnessy on Monday October 17, 2011 @10:28AM (#3120587)
That's a great question. I suppose they split it up into separate requests since downloading all of the dependencies at the same time might end up being slow and returning a lot of data, especially for something like Rails with a lot of dependencies. Or maybe separate requests was fast enough and a good trade off between speed/data and number of requests.
Re:Why Bundler 1.1 will be much faster by moeffju on Monday October 17, 2011 @01:31PM (#3121458)
But bundler cannot determine which versions it needs until it has all dependencies, right? And in effect, all it does is recursively call for one "layer" of dependencies after the other, so it seems like the backend might just as well recursively query itself and return all dependencies at once.
Re:Why Bundler 1.1 will be much faster by pilif on Monday October 17, 2011 @10:52AM (#3120691)
as you have seen in the article, bundler needs dependencies of all versions as it might have to deal with older releases. Building the whole dependency graph for all versions of a gem with many dependencies in itself will a) take a very long time and b) probably be huge - likely much bigger than the whole gem index that was downloaded up until 1.1. The time required for parsing those MB after MB of data of which most will be thrown away will quickly get significant.

Another option would be to query for all dependencies of a specific version of a gem. That would reduce the amount of data, but it would still mean more work for the server and it would produce a lot more data to cache (much of which would never be queried more than once)

With the currently applied method, only the data that's really required must be queried and it can easily be cached on the server side too.

Re:Why Bundler 1.1 will be much faster by alexrothenberg on Monday October 17, 2011 @11:05AM (#3120744)
I suspect its a question of server resources. Dependency analysis is bundler's job and its better to let thousands of cpus run the algorithm. This leaves rubygems.org to simply service simple queries quickly without much load even though it means there will be many queries as part of each bundle.
Re:Why Bundler 1.1 will be much faster by qrush on Monday October 17, 2011 @01:04PM (#3121342)
We could try more than one layer. At the time we wrote it (last summer) the Bundler guys wanted to just start with one layer.