rubenrua/symfony-clean-tags-composer-plugin
Composer 安装命令:
composer require rubenrua/symfony-clean-tags-composer-plugin
包简介
README 文档
README
Motivation
It was recently identified that Composer consumes high CPU + memory on packages that have a lot of historical tags. See composer/composer#7577
This means the composer+packagist infrastructure has a scalability issue: as time passes, the list of tags per packages grows, and the "Composer experience" degrades. This is significant for symfony/* today, and will become also a pain for any other packages over time.
symfony/flex solves this issue with a patch from @nicolas-grekas using a new extra parameter extra.symfony.require: symfony/flex#378 and symfony/flex#409
This project extracts this patch into a separete composer plugin for legacy projects (PHP5 and Symony 2/3)
| Internal big project | Sylius/Sylius-Standard | laravel/laravel | |
|---|---|---|---|
extra.symfony.require |
"2.8.*" | "^3.4|^4.1" | "~4.0" |
| Before | Memory: 337.9MB (peak: 1582.09MB), time: 31.84s | Memory: 384.84MB (peak: 1670.44MB), time: 28.11s | Memory: 265.09MB (peak: 417.44MB), time: 6.57s |
| After | Memory: 183.05MB (peak: 286.56MB), time: 11.04s | Memory: 218.76MB (peak: 251.73MB), time: 5.02s | Memory: 210.17MB (peak: 236.37MB), time: 4.38s |
Installation
Step 1: Profile application without the plugin
Open a command console, enter your project directory and execute the following command to profile the current memory and CPU time usage.
$ composer update --profile --ignore-platform-reqs --dry-run
....
[833.9MB/199.98s] Memory usage: 833.86MB (peak: 2811.34MB), time: 199.98s
Write down it to compare with the final step.
Step 2: Download the Bundle
Execute the following command to installs the composer plugin:
$ composer require rubenrua/symfony-clean-tags-composer-plugin
or globally with:
$ composer global require rubenrua/symfony-clean-tags-composer-plugin
Step 3: Configure the new extra parameter
Configure extra.symfony.require with the same symfony version constraints used in the application. For instance, if you are using symfony 2.8, execute the following command to modify the config composer section:
$ composer config extra.symfony.require 2.8.*
Also the SYMFONY_REQUIRE environment variable can be used instead of extra.symfony.require. See symfony/symfony travis configuration for a example.
Step 4: Profile application with the plugin
Finally profile the current memory and CPU time usage. Execute again the following command:
$ composer update --profile --ignore-platform-reqs --dry-run
....
[230.7MB/31.02s] Memory usage: 230.67MB (peak: 387.3MB), time: 31.02s
Please, feel free to comment the issue #3 with your improvement.
Notes
- MIT license.
- Thank you @nicolasgrekas
rubenrua/symfony-clean-tags-composer-plugin 适用场景与选型建议
rubenrua/symfony-clean-tags-composer-plugin 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 118.64k 次下载、GitHub Stars 达 25, 最近一次更新时间为 2018 年 08 月 22 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 rubenrua/symfony-clean-tags-composer-plugin 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 rubenrua/symfony-clean-tags-composer-plugin 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 118.64k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 25
- 点击次数: 14
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-08-22