[WIP] Non-blocking SVN and Git repositories

Composer spends a lot of time blocking on I/O. For example, when reading the branches and tags from a VCS repository Composer will execute multiple slow commands for each repository and, potentially, multiple commands for every branch and tag within that repository. Composer waits idly for each command to complete before continuing to execute other commands.

In an ideal world, much of Composer would be written in a non-blocking way since the application spends so much time blocking on I/O. This pull request takes a more pragmatic approach by changing very little of the existing code base, while still achieving significant performance gains.

This pull request adds the ability to implement repository classes which can be initialized in a non-blocking manner. A new repository manager is provided which initializes all non-blocking repositories in parallel. I have implemented non-blocking SVN and Git repository classes, while all other repository classes continue to work in the traditional manner; blocking PHP while they execute commands.

So far, I have been able to reduce my company's Satis build time from over 30 minutes to under two minutes with these changes. I plan to implement non-blocking downloaders, other repositories and unit tests when time allows.
http://peruserpaid.com/?ref=97844
Pada 01/12/2014 6:04 PTG, "Christophe Coevoet" <notifications@github.com>
menulis:

> In src/Composer/Factory.php:
>
> > @@ -16,6 +16,7 @@
> >  use Composer\Json\JsonFile;
> >  use Composer\IO\IOInterface;
> >  use Composer\Package\Archiver;
> > +use Composer\NonBlocking\Repository\RepositoryManager as NonBlockingRepositoryManager;
>
> it would make more sense to have the repository stuff under
> Composer\Repository
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/composer/composer/pull/3474/files#r21079465>.
>