Another common slow down is bind mounts. Each file system operation is an RPC request between Docker for Mac and the Linux VM.
I’ve never been super happy with Docker for Mac. I did a pretty deep dive into figuring out why it’s so slow with no satisfying conclusion: https://stackoverflow.com/q/58277794/30900