Simple Puppeteer script for measuring DDEV performance.
This tries to use a DDEV Drupal 10 project as a measure of performance using a web install of the demo_umami
profile.
- To use this, you need Node.js,
npm init && npm i puppeteer async
. - The project named in
ddev-puppeteer.js
should be a standard Drupal 10 install as per the DDEV Drupal 10 quickstart - Edit
site
andsitedir
inddev-puppeteer.js
. - Set up the project with Mutagen or Colima or whatever permutation you like.
- The project should already be running.
- Run the test with
node ddev-puppeteer.js
.
- This is using the Drupal
demo_umami
profile, which takes longer thanstandard
. - The script resets php-fpm at the beginning to make sure we start without a PHP OPcache. This may or may not be fair.
- To see what’s happening in the install you can change
puppeteer.launch({headless: true})
topuppeteer.launch({headless: false})
. - The Drush install is
ddev mysql -e "DROP DATABASE IF EXISTS db; CREATE DATABASE db;" && ddev exec killall -USR2 php-fpm && rm -rf web/sites/default/files/* && ddev mutagen sync && time ddev drush si demo_umami -y
- Links:
- Early measurements of performance with Mutagen on ddev.com.
- Puppeteer quickstart
- async docs
- How to use series function in async
- Useful Puppeteer examples.
Thanks so much to @froboy and his inspiring measurements in https://gist.github.com/froboy/f237bf62cfde5350c0849c6e9aab0c71