Open paolomainardi opened 2 years ago
Devcontainers info:
Another test with:
➜ bench-macos git:(main) make
Testing: Native installation...
real 4.02
Testing: Docker without volumes...
real 0m 6.56s
Testing: Docker with a bind mount: './create/react/app:/usr/src/app' and a volume on: 'nodemodules:/usr/src/app/node_modules'
real 0m 7.04s
Testing: Docker with a bind mount: ./create-react-app:/usr/src/app
real 0m 21.86s
Context
We all know that Docker performance on mac for some cases is quite limited in terms of filesystem performance, mainly caused by the shared network disk between the host and the docker for mac VM.
There is a long-standing issue you can find here: https://github.com/docker/roadmap/issues/7
We as a company invested a lot in the past to reach close-native performance between Linux and macOS, in the docker-machine era we used NFS sharing which leads to very close native performance, then we decided to mainly use Linux for our developer workstations also to avoid this kind of performance issues.
With the Apple Silicon era, we decided to invest again in macOS for our developer workstations, as the machines are powerful, cheap and with the best-in-class hardware you can find on the market now.
The current Docker for Mac improved a lot the filesystem sharing issues, but it still falls behind the native performance, especially with heavy fs scenarios usage like
Node
andPHP
withnode_modules
andvendor
directories which can become very very big also in simple projects.Benchmark
Repository: https://github.com/paolomainardi/docker-for-mac-bench
I am going to use
create-react-app
as a use case scenario, the test is executed:node_modules
Filesystem
Native
Doker for mac - gRPC Fuse (default)
Docker for mac - Virtiofs (beta)
CPU
macOS 13