Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> Even on MacOS side QEMU does not support Rosetta 2.

Is Rosetta 2 that much faster than QEMU's own translation? Why?



>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.


Anecdata: 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.


QEMU 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.


It'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).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: