We have to migrate a few hundred packages to composer, using VCS repository on GitHub and I noticed its even on root servers extreme slow, using a average app with 20 to 30+ packages. On home machines its even worst. In fact it makes the work really tedious and somehow unacceptable.
我们必须使用GitHub上的VCS存储库将几百个包迁移到composer,我注意到它甚至在根服务器上极其缓慢,使用一个20到30+包的普通应用程序。在家用机器上它甚至最差。事实上,这使得工作变得非常单调乏味,并且在某种程度上是不可接受的。
Are there any improvments which can be done to speed it up? Zip or packagist is not an option for us either.
有什么改进可以加快它吗? Zip或packagist也不是我们的选择。
3 个解决方案
#1
16
Use Prestissimo
Prestissimo is a global Composer plugin that installs dependencies in parallel. It is crazy fast. It’s worth noting that Prestissimo requires cURL, which may not work behind certain firewalls or proxies. I haven’t run into any issues at all personally.
Prestissimo是一个全局Composer插件,可以并行安装依赖项。这很疯狂。值得注意的是,Prestissimo需要cURL,这可能不适用于某些防火墙或代理。我个人没有遇到任何问题。
#2
4
Making sure your composer.lock
files are in version control and in your main project is critical for making composer install
fast. It contains a list of packages and information about them (including specific versions) that Composer uses to speed up the installation process.
确保您的composer.lock文件处于版本控制和主项目中对于快速安装作曲家至关重要。它包含一个包列表以及Composer用于加快安装过程的信息(包括特定版本)。
See https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file for further details.
有关详细信息,请参阅https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file。
#3
2
Two things I would try
我会尝试两件事
1) Use the verbose option -v to see what's taking so long. It could be your internet bandwidth or latency, or something else surprising.
1)使用详细选项-v查看花了这么长时间。它可能是您的互联网带宽或延迟,或其他令人惊讶的事情。
2) use the --no-dev and --prefer-dist options to prevent composer considering versions you aren't using in production.
2)使用--no-dev和--prefer-dist选项来防止作曲家考虑你没有在生产中使用的版本。
Thirdly :) you could run a regular background composer update somewhere to keep the caches up to date. So at least your installs would be a bit quicker.
第三,你可以在某处运行常规的后台编辑器更新,以使缓存保持最新。所以至少你的安装会更快一些。
(Ps. I'm sure there was -v -vv and -vvv for levels of detail but I cannot see that in the docs now... I thought only the second level gave you download speeds.)
(Ps。我确定有-v -vv和-vvv的详细程度,但我现在在文档中看不到...我认为只有第二级才能给你下载速度。)
#1
16
Use Prestissimo
Prestissimo is a global Composer plugin that installs dependencies in parallel. It is crazy fast. It’s worth noting that Prestissimo requires cURL, which may not work behind certain firewalls or proxies. I haven’t run into any issues at all personally.
Prestissimo是一个全局Composer插件,可以并行安装依赖项。这很疯狂。值得注意的是,Prestissimo需要cURL,这可能不适用于某些防火墙或代理。我个人没有遇到任何问题。
#2
4
Making sure your composer.lock
files are in version control and in your main project is critical for making composer install
fast. It contains a list of packages and information about them (including specific versions) that Composer uses to speed up the installation process.
确保您的composer.lock文件处于版本控制和主项目中对于快速安装作曲家至关重要。它包含一个包列表以及Composer用于加快安装过程的信息(包括特定版本)。
See https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file for further details.
有关详细信息,请参阅https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file。
#3
2
Two things I would try
我会尝试两件事
1) Use the verbose option -v to see what's taking so long. It could be your internet bandwidth or latency, or something else surprising.
1)使用详细选项-v查看花了这么长时间。它可能是您的互联网带宽或延迟,或其他令人惊讶的事情。
2) use the --no-dev and --prefer-dist options to prevent composer considering versions you aren't using in production.
2)使用--no-dev和--prefer-dist选项来防止作曲家考虑你没有在生产中使用的版本。
Thirdly :) you could run a regular background composer update somewhere to keep the caches up to date. So at least your installs would be a bit quicker.
第三,你可以在某处运行常规的后台编辑器更新,以使缓存保持最新。所以至少你的安装会更快一些。
(Ps. I'm sure there was -v -vv and -vvv for levels of detail but I cannot see that in the docs now... I thought only the second level gave you download speeds.)
(Ps。我确定有-v -vv和-vvv的详细程度,但我现在在文档中看不到...我认为只有第二级才能给你下载速度。)