-
-
Notifications
You must be signed in to change notification settings - Fork 783
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
Asset installation of 2.0.13 very slow with cap installed #149
Comments
That would only affect new projects, not existing ones since that's a template. |
Sorry, I don't get it, what do you mean with "that"? I am just saying that there was a perfect configuration for all use-cases, now an essential speed upgrade is removed for no reason. |
This is why I asked for an option to disable c-a-p from composer.json: fxpio/composer-asset-plugin#249 |
Depends on what you want, with the right config the performance is almost the same. |
But the current configuration is bad regardless. This template currently assumes that you do not have c-a-p installed globally, but that assumption is wrong. It should therefore disable c-a-p explicitly, otherwise c-a-p will run, causing slowness and problems. |
It makes no assumption about that, it just does not disable the plugin by default, which is fine.
Not anymore with the configuration which was removed. If you want to disable c-a-p, use the ENV var or a |
Should be...
or |
Even with the git configuration, it is slower than not running the plugin at all. Plus with c-a-p enabled, you'll get duplicated packages: both c-a-p and asset-packagist will give composer's dependency solver two separate packages, with all their versions, which will make it slower and cause it to use more memory. |
with asset-packagist, c-a-p disabled:
with asset-packagist, c-a-p enabled and set to use git, last 2 days (like the previous config), first run:
second run:
More than a minute vs 2.5 seconds. without using git, i.e. if you have c-a-p installed and you try to use this template:
Wait, wasn't git supposed to be faster? In all cases I ran composer update --profile without deleting vendor, and there were no updates. Feel free to benchmark other cases, but I think this is convincing enough. So clearly the plugin should be disabled by default. If someone wants to use c-a-p, they can remove asset-packagist and re-enable the plugin in their composer.json. |
Considering @nkovacs benchmark, I think that removal of CAP from the template is a good move and should stay like that. |
But you need to disable it in composer.json. It is currently enabled if you have it installed globally, which you probably have if you've used this template before. |
@nkovacs With which version of the asset-plugin did you run your benchmarks? The bower URL was updated in My benchmarks for the yii2-basic-app are (2nd run):
|
You're right, I was using 1.3. All the packages were already downloaded and cached. |
Having both in the The thing is, if you have c-a-p installed, you want to have the fast config. If you don't have c-a-p (can be removed from the docs, I don't mind) a basic installation works fine (and even slightly faster) with AP. |
But subtle bugs like that are exactly why it's not a good idea to have both c-a-p and asset-packagist active in a project. Plus you'll get inconsistent behavior if you're working with someone else who doesn't have c-a-p installed. |
That's true but only to a certain degree, since AP will not be used, if you have c-a-p installed. But they are valid points, I think we can agree on:
I'd be fine with |
But it will. c-a-p will feed composer the bower/npm packages it finds, but composer will also get those packages from asset-packagist, and both sets of packages will end up in composer's dependency solver. That's why you get bugs like hiqdev/asset-packagist#72 |
Makes perfect sense, although when using both it looks like c-a-p always takes precedence - "AP will not be used" is the wrong term here. Both
AP only
c-a-p only
Tested with phd5 Look how much faster c-a-p is 😸 - jokes aside - there should only be one active one. |
@SilverFire @samdark the plugin is disabled, but it should still have a useable config |
@SilverFire would you please take a look at this one and related ones? Thanks. |
We need at least something in the docs how to configure |
I don't think we should encourage using it. |
I give up ... if you think there should be no note about the correct configuration of a piece of software which was required for years and which is still required if you use just one asset bundle which has sadly hundreds of releases. I must state that the way how the whole (silent) replacement of Since the information about Just my 2 cents. |
What steps will reproduce the problem?
Install the basic-app with global fxp/cap installation
What's expected?
What do you get instead?
Additional info
Introduced by 395e9c7
Whether you like the asset-plugin or not is no question here, but removing all the stuff introduced without BC-break in 120d355 - one day earlier, just makes no sense to me.
If you have a global cap installation you can not use this anymore, please do not force this onto the developers, I have plenty of reasons not to use AP in many projects.
The settings and info have no effect, if do not have fxp/cap installed, they simply take care that things work as before, just almost as fast as with AP.
Such a removal has to be done in 2.1 not earlier. I'd assume the majority of users still have the plugin installed, since it was the recommended way for years.
If you want to disable fxp/cap, you could add a config option to
composer.json
for that, but I think this should also be the developers choice.The text was updated successfully, but these errors were encountered: