M1 Mac: Should you enable efficiency cores in Docker?

Posted on Fri 20 January 2023 in tech

Should you enable your efficiency cores for use by Docker on Apple Silicon?

If you enable the efficiency cores there are 2 additional cores for the system scheduler to allocate to your workload. However, if you leave them disabled, these 2 cores will remain in reserve for use by supportive tasks and the desktop.

Running the full build of the very expensive Foundry Docker Image with 8 performance cores. The build runs in 7 munites 35 seconds.

Foundry tools build (rust) 8 performance cores, 16gb, 32gb m1 max

#52 exporting to image
#52 sha256:e8c613e07b0b7ff33893b694f7759a10d42e180f2b4dc349fb57dc6b71dcab00
#52 exporting layers
#52 exporting layers 3.4s done
#52 writing image sha256:903dc558a073a00563c1e7efa094090f2d61b59b283ed238fda57ff4d06c9883 done
#52 naming to docker.io/collectivexyz/foundry:30245140 done
#52 DONE 3.4s

real    7m35.867s
user    0m1.040s
sys 0m0.950s

In comparison, enabling the 2 additional efficiency cores does not dramatically impact the build time.

Foundry tools build (rust) 8 performance cores, 2 efficiency, 16gb docker, 32gb m1 max

#52 exporting to image
#52 sha256:e8c613e07b0b7ff33893b694f7759a10d42e180f2b4dc349fb57dc6b71dcab00
#52 exporting layers
#52 exporting layers 3.4s done
#52 writing image sha256:66e37224ece4dd1a82871d718625ad09484445e63a358ad775e48ce65077a481 done
#52 naming to docker.io/collectivexyz/foundry:30245140 done
#52 DONE 3.4s

real    7m30.641s
user    0m0.939s
sys 0m0.789s

View on YouTube

It turns out the MacOS scheduler almost immediately promotes intensive workloads to the performance cores. Therefore you should not enable efficiency cores on Apple Silicon for performance intensive workloads.