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

Question: Performance improvements possible? #42

Closed
cebe opened this issue Sep 29, 2014 · 3 comments
Closed

Question: Performance improvements possible? #42

cebe opened this issue Sep 29, 2014 · 3 comments

Comments

@cebe
Copy link
Contributor

cebe commented Sep 29, 2014

Currently composer queries bower.json for versions that it is never going to install because of version constraints. Is it somehow possible to avoid these requests?

Having the latest version of composer and the composer-asset-plugin and run the following command:

composer create-project --prefer-dist --stability=rc yiisoft/yii2-app-basic basic
Installing yiisoft/yii2-app-basic (2.0.0-rc)
  - Installing yiisoft/yii2-app-basic (2.0.0-rc)
    Loading from cache

Created project in basic
Loading composer repositories with package information
Installing dependencies (including require-dev)

Could not fetch https://api.github.com/repos/jquery/jquery, enter your GitHub credentials to go over the API rate limit
The credentials will be swapped for an OAuth token stored in /home/cebe/.composer/auth.json, your password will not be stored
To revoke access to this token you can visit https://github.com/settings/applications
Username: cebe
Password: 
Token successfully created
Reading bower.json of bower-asset/jquery (1.8.3)^C   

As you can see it is trying to get bower.json for jquery 1.8.3 which is not installable anyway because of the version constraint "2.1.*@stable | 1.11.*@stable". Is it possible to avoid these requests somehow?

@francoispluchino
Copy link
Member

Alas, this is not possible, and for good reason, it's the Solver wishing retrieve package dependencies via the method getRequire. Even with the lazy loader package, once the Solver want to compare versions, the complete loading of packages to compare is performed.

You'll have more details in the issue #5 to this comment.

Regarding your composer.json file, all versions of jquery >=1.7 are got, because as several dependencies have this constraint, and given that the Solver is a Solver SAT, it will get the contents of all the versions allowed by this constraint.

List of dependencies:

  • bower-asset/jquery.inputmask: jquery >=1.7
  • bower-asset/yii2-pjax: jquery >=1.8
  • bower-asset/typeahead.js: jquery >=1.7
  • bower-asset/boostrap: jquery >=1.9.0

You will find that with the option -v, there is only the packages of jquery >=1.7 that are recovered (and not all versions).

However, 2 issues on improving performance for Composer were created:

For the Solver, after discussion, it is not possible because of the type of Solver (SAT).

The performance could be much better (especially for VCS repositories), by using curl without the follow redirects, and to do manually the redirection (up to 6x faster).

@cebe
Copy link
Contributor Author

cebe commented Sep 30, 2014

Great, thank your very much for the detailed answer! :)

@francoispluchino
Copy link
Member

The issue #52 improves significantly the performance for the update.

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

No branches or pull requests

2 participants