Giter Club home page Giter Club logo

composer-drupal-optimizations's Introduction

Optimize Composer for Drupal projects

Build Status Packagist

About

This composer-plugin contains a set of improvements that makes running heavy duty composer commands (i.e. composer update or composer require) much faster.

Composer 2

Since Composer 2 is quite fast by default, this plugin is not needed, and will be disabled if Composer 2 is detected. If everyone involved in development of a project is using Composer 2, this plugin becomes redundant and can be removed from the list of project dependencies.

Installation

composer require zaporylie/composer-drupal-optimizations:^1.1 --dev

No configuration required ๐ŸŽŠ

Optimizations

  • Reduce memory usage and CPU usage by removing legacy symfony tags

Benchmark

Following numbers are for clean https://github.com/drupal-composer/drupal-project/ without and with this plugin.

Before:

Memory usage: 323.19MB (peak: 1121.09MB), time: 13.68s

After:

Memory usage: 238.66MB (peak: 297.17MB), time: 4.84s

php 7.2, macOS High Sierra, i7, 16GB RAM

Configuration

If no configuration is provided this package will provide sensible defaults based on the drupal/core version constraint in the root composer.json file. Default configuration should cover 99% of the cases. However, in case you want to manually specify the tags that should be filtered out you are welcome to use the extra section:

{
  "extra": {
    "composer-drupal-optimizations": {
      "require": {
        "symfony/symfony": ">3.4"
      }
    }
  }
}

Recommendation note: Use defaults (skip config above) if possible - this package will be maintained throughout the Drupal's lifecycle in order to optimize legacy constraints in parallel with Drupal's requirements.

All you have to do is to make sure your drupal core constraint in the root composer.json is set to drupal/core: ^8.5 or above. If you use a Drupal distribution, be sure to explicitly require drupal/core in your own project as well.

Credits

  • Symfony community - idea and development; Special thanks to @nicolas-grekas
  • Jakub Piasecki - port and maintenance

composer-drupal-optimizations's People

Contributors

zaporylie avatar danepowell avatar neclimdul avatar mpparsley avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.