Performance comparison for Docker for Mac, VM Linux Docker and Linux Docker Native
Reducing developer cycle time between a code change and running a test case is hugely important for an effective working environment. Developers can maintain focus and not get distracted by pausing and waiting for things to finish.
With Docker becoming a standardised toolset for developing and running services locally, it is important that it does not add additional overhead in cycle time.
Here we compare the performance of various machine setups. We run a single test, and the entire test suite, across an Elixir service. The change induced was a config change which involves a recompile (87 files), and we initiated the test framework. The second test included the same change but running the full test suite.
║ Machine ║ One Test ║ Test Suite ║
║ 1. Docker for Mac ║ 1m41.2s ║ 2m45 ║
║ 2. Mac - VM - Linux - Docker ║ 0m6.1s ║ 0m56 ║
║ 3. Linux - Docker ║ 0m4.2s ║ 0m23 ║
Machines 1 and 2 are recent MacBook Pros: 2.6 GHz Intel Core i7 with 16G Ram. Machine 3 is a more powerful Thinkpad X1E I7 8750H 32G Ram.
The tests showed that using Docker for Mac for development is a rather poor (read terrible) experience.
Presumably this is due to the file sharing system between the docker container and the host machine — Docker for Mac / Mac OS have still got a long way to go here. We run a shared file system so changed files can be pushed to git using the host credentials. (Please see the following story on how to Optimise for Docker for Mac).
If you develop on a Mac, either spend time optimising the file sharing mechanism, or run a Linux VM with Docker for Linux for your development . For top performance, consider ditching the fancy Apple gear in favour of a clunky IBM (oops Lenovo).
Read the follow-up article on Optimising Docker for Mac and Elixir.