In agency-based development, it's not uncommon to work on multiple projects at once, many times with different hosting requirements such as memcache, solr, or even things like PHP version. Tools like Docksal, DDev, and Lando are pretty common around the Drupal community and have made developer's lives a lot easier from the days of having to configure your own LAMP/LEMP for projects, but one thing MacOS users run into here is an extreme performance hit. This is due to the file system binding on OS X.
Unfortunately there wasn't much solution for this other than allocating more resources to docker, but then I stumbled upon Mutagen. I won't dive into the details of it as that's not the intended purpose of this post and it's documented well, but here's what we did using Docksal to change how we sync our local files. This likely can easily be adopted for DDev or Lando as well.
Forewarning: Running through this process on an existing project may require you to reset other conainters such as the Database, I suggest trying this on a test project or one you don't mind resetting.
Install Mutagen:
Simple enough:
bashbrew install mutagen-io/mutagen/mutagen
Remove volumes from Docksal:
Add the following to either your .docksal/docksal.env or .docksal/docksal-local.env depending on your setup:
bashDOCKSAL_VOLUMES=none
Then restart your project with fin stop && fin start
Mutagen configuration:
Read the docs here, but a simple example such as this can get you up and running. Add mutagen.yml to your repository root with the following:
yaml
sync:
defaults:
mode: "two-way-resolved"
ignore:
vcs: true
paths:
- "*.sql"
permissions:
defaultFileMode: 644
defaultDirectoryMode: 755
mySyncSession:
alpha: "."
# CHANGE THIS TO YOUR DOCKSAL PROJECT CLI CONTAINER
beta: "docker://docker@<docksal project name>_cli_1/var/www"
ignore:
paths:
- ".idea"
- "node_modules"
Note the commented line, to find the name of your docker image for docksal, run fin docker ps, usually it will be something like "project_cli_1".
Then run mutagen project start && mutagen sync monitor once your status is "Watching for changes" then you can CMD+C out of that
Rejoice!
Now that your files are syncing with mutagen, there's no more crazy I/O lag from local to container, here are some tests on my machine using a quite large project, you can expect even better results on less module/content-heavy setups:

(sorry about the image, Contentful doesn't support tables and was too lazy to work around it today)
As you can see there's a MASSIVE improvement, especially with Drush commands. This also shows when using the Drupal UI, pages are much snappier.
I'd highly suggest tweaking these settings to meet your needs, but this guide should get you started pretty easily.