It is much better than it was not so long ago due to actually working at all, and it appears there is much more room for optimization, so the comparison is not over yet. But as of right now, it isn't that great.
It is much better than it was not so long ago due to actually working at all, and it appears there is much more room for optimization, so the comparison is not over yet. But as of right now, it isn't that great.
TBH it's surprising that it's only 'quite a bit far behind'.
Compare Intel vs M1 Macs with x86 vs ARM containers, and you will be blown away with the performance increase.
That is a strange way to put it. Rosetta 2 (and orig.) is not virtualization, it is emulation, though there is a half-decent argument that Rosetta 2 (and orig.) is not emulation either -- it is recompilation.
If you run an x64 Mac binary on the host, Rosetta (simplified) translates the code to arm64 then runs it. If you run a Linux VM and execute an x64 Linux binary or container inside it, Rosetta can’t help you. You’ll be running inside a big emulator - in fact, Docker Desktop uses QEMU under the hood I think.
But it's not as if you can't run a virtual machine native to the platform. Qemu works on M1, Parallels works on M1 (ARM VM only) and there is a preview for VMWare's Hypervisor that will run even Windows 11 on the M1, but the VM software is native code (but not necessarily the system in the VM), so Rosetta isn't used.
The performance of this will be terrible; there is likely little room for optimisation and you should not expect this to get any faster in the future.
Using aarch64 containers changes the game entirely. Common base images like Ubuntu are already multiarch so will just work out of the box. But this has obvious downsides and won’t be a suitable solution for everyone.
In one of our projects the benchmarks look like this to run our test suite for a web app using volume mounts:
- 2020 Intel MBP (10th gen CPU, 32GB of memory, SSD): 37 seconds
- First generation M1 MBP: 31 seconds
- WSL 2: 3 seconds
The WSL 2 box is an old workstation I have from 6-7 years ago with an i5 3.2ghz CPU, 16gb of RAM and one of the first SSDs. All in all it was about $800.
The WSL 2 box is so fast for Docker because the volume performance is pretty much as good as native Linux. It's really fast.
I've seen some very serious savings after switching Java workloads to ARM.