Skip to content

Instantly share code, notes, and snippets.

@oxyc
Last active June 4, 2016 16:57
Show Gist options
  • Save oxyc/7c768feaa3c16a9f52c1196689f3a0a7 to your computer and use it in GitHub Desktop.
Save oxyc/7c768feaa3c16a9f52c1196689f3a0a7 to your computer and use it in GitHub Desktop.
a note on performance

A note on build time performance

Opting for composer based installs will most likely increase your VM's time to provision considerably. There are a couple of ways you can improve this.

Install vagrant-cachier plugin

If you manage multiple VM's on your computer, you can use the vagrant-cachier plugin to share Composer's package cache across all of them.

  1. Install the plugin on your host computer: vagrant plugin install vagrant-cachier
  2. Create a Vagrantfile.local next to your config.yml with the following:
config.cache.auto_detect = false
config.cache.enable :generic, { :cache_dir => "/home/vagrant/.composer/cache"  }

Note: Out of the box sharing the Composer cache is not supported as the plugin requires PHP to be installed before the provision takes place. This is why the generic cache bucket is used instead.

You can also use this plugin to share other package manager caches. For more information read the documentation.

Use prestissimo for installing composer packages in parallel

The main performance decrease with using Composer over Drush makefiles will be the time it takes to download package repositories. Prestissimo will not improve this but it can still increase performance by installing packages in parallel.

Add the following to your config.yml to use Prestissimo whenever composer installs packages:

composer_global_packages:
  - { name: hirak/prestissimo, release: '^0.2' }
@oxyc
Copy link
Author

oxyc commented Jun 4, 2016

Just realized scope was a required setting. Didn't catch that when glancing the docs...

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