Closed geerlingguy closed 4 years ago
For Drupal VM I'm adding it as a composer dev dependency: http://docs.drupalvm.com/en/latest/deployment/composer-dependency/
It's strange, I would've thought the Symfony Local server would be a lot faster, but it seems it was as slow as the custom Docker environment! I made sure to test with opcache enabled and disabled. With it disabled the UI is very slow. With it enabled the UI is faster. CLI speed seemed to not be impacted even if I turned everything off and set it enabled on cli (and confirmed via drush php-ev
).
Drupal VM is the winner—once it's up and running. But it takes a minute or two to get started (versus only a few seconds for the others).
So I'm kind of at a crossroads here. I think I'll end up sticking with the custom docker setup, mostly because that doesn't require me to have a fully-tweaked and operational local PHP 7.3 environment running (which could make it more annoying to work on in different environments, especially if I want to work from a PC running Linux or Windows here and there).
I filed some PRs for the other environments (DDEV, Drupal VM, Symfony Local) and closed them so that I have the reference point if I should choose to use one of them in the future.
Honestly, Drupal VM felt the fastest (by a good margin—especially for installation), but it also feels very heavyweight... and means that I can't have the exact same setup in CI (and eventually in production, if I use Docker) as I have locally... which I don't particularly enjoy.
So closing this issue and I might have some good material for a blog post at some point, otherwise I'll leave this as-is.
Also note: https://github.com/geerlingguy/drupal-the-fastest
While working on #22, I decided to test things out with NFS. Might also try docker-sync or one of the other sync methods too.
TIL, you can add a docker-compose.override.yml
file and it will be merged into the structure of the main docker-compose.yml
file. You an also specify multiple compose files with -f
and they'll be merged. That's how I'll get things going for CI and local with different volume mounts.
Heh, I also attempted a Drupal install without cached/delegated on the volume mount, and not only did it consume 5% of my battery (and 200% of my CPU), it took a whopping 5 minutes!
Well, pretty happy now. I'll be summing this stuff up in a blog post.
Thanks for the thorough bench-marking. I compared plain vanilla installs of Drupal 8 between ddev and Lando. They seem to perform almost at the same speed, except for Lando start
, which takes 60 seconds, compared to ddev's 15 seconds.
System
Get the Drupal 8 code with Composer
$ time composer create-project drupal/recommended-project drupalddev
real 0m6,357s
$ time lando init --source cwd --recipe drupal8 --webroot web --name drupallando
real 0m0,334s
$ time lando start
real 1m1,861s
$ time drush site:install --db-url=mysql://drupal8:drupal8@database/drupal8 -y
real 0m16,639s
$ time curl http://drupallando.lndo.site
real 0m1,452s
$ time drush cache:rebuild
real 0m2,719s
$ time ddev config --project-type drupal8
real 0m0,040s
$ time ddev start
real 0m14,813s
$ time ddev exec drush site:install -y
real 0m15,121s
$ time curl http://drupalddev.ddev.site
real 0m1,325s
$ time ddev exec drush cache:rebuild
real 0m4,177s
I just upgraded to the latest Lando v3.0.0-aft.2, and the first lando start
of a new instance is 50% faster, down to half a minute. Just to clarify, I haven't timed the very first start after installing Lando itself, where PHP, MySQL and the rest of the software is downloaded. Here are the values for easier comparison, all times are in seconds:
Tool | First start | Start | site:install | 1st / page load (curl) | cache:rebuild |
---|---|---|---|---|---|
ddev 1.13.1 | 11.3 | 11.2 | 15.1 | 1.3 | 4.2 |
Lando v3.0.0-rc.23 | 61.9 | 7.6 | 16.6 | 1.5 | 2.7 |
Lando v3.0.0-aft.2 | 28.6 | 9.3 | 16.5 | 1.5 | 2.7 |
@gitressa - Thanks so much for adding these details here! It may be time to revisit my project https://github.com/geerlingguy/drupal-the-fastest and update things again for 2020.
You're welcome @geerlingguy :-) Revisiting and updating the bench-marking project would certainly be of great interest to me, and surely many others.
I noticed that the Lando script also downloads Drush 10, which will take around 20 seconds longer, compared to for example ddev:
# Install Drush, then install Drupal inside Lando.
lando composer require drush/drush
https://github.com/geerlingguy/drupal-the-fastest/blob/master/methods/lando.sh https://github.com/geerlingguy/drupal-the-fastest/blob/master/methods/ddev-local.sh
Lando does come with Drush 8.3.2 out of the box, but perhaps Drush wasn't included, when the lando.sh script was initially created?
I have created a PR which updates Lando and removes Drush installation https://github.com/geerlingguy/drupal-the-fastest/pull/9.
After episode 6, Oliver Davies mentioned the Symfony Local Server, and I thought it might be time—especially since the live stream software eats my little MacBook Pro's CPU for lunch—to try out a faster local dev environment.
Because I'm one for data, I'd rather test things out with some 'official' timings, like how long it takes to install Drupal, to run a cache rebuild, and to migrate things.
So here's a table with some data:
/
page load (curl)Commands run: