3 ms·
> Even on MacOS side QEMU does not support Rosetta 2. Is Rosetta 2 that much faster than QEMU's own translation? Why?
by pxc 4y ago
> Even on MacOS side QEMU does not support Rosetta 2.
Is Rosetta 2 that much faster than QEMU's own translation? Why?
- nicce 4y agoQEMU makes translation in Just-in-Time. Rosetta ”pre-builds” binaries to match different architecture, and binaries eventually run ”natively”, with the cost of delayed start.
- NovemberWhiskey 4y ago>Is Rosetta 2 that much faster than QEMU's own translation Oh yes. Based on the benchmarks I've seen it's a good 30-40% faster on compute workloads. I assume that the pre-transpilation of the binaries is advantageous relative to having to virtualize the CPU.
- lloeki 4y agoAnecdata: on my workloads it's near-native† vs ~10x slower for QEMU † actually not measured, but compared to the order of magnitude on the other side it's about that, eyeballed against the same code on aarch64.
- jlokier 4y agoIt's not obvious that QEMU's JIT has to be a lot slower, but it is. It may be that Rosetta 2 is just more thoroughly engineered and tuned for Apple Silicon. Among other things, Rosetta 2 is able to use the CPU's special TSO memory ordering mode, which I think QEMU's TCG cannot use so has to use barrier instructions instead (MTTCG), or run all the virtualised CPU threads on a single host core (obviously slower for parallel workloads).