Why is Rosetta 2 fast?
dougallj.wordpress.com
Why is Rosetta 2 fast?
1–10 of 367 posts
Re: Why is Rosetta 2 fast?
#2Re: Why is Rosetta 2 fast?
#3Re: Why is Rosetta 2 fast?
#4Re: Why is Rosetta 2 fast?
#5The main reason, M1/2 being incredibly fast. Is listed last.
20% overhead for a non-native executable is very commendable.
Re: Why is Rosetta 2 fast?
#6I hope Rosetta is here to stay and continues developement. And I hope what is learned from it can be used to make a RISC-V version of it. translating native ARM to RISC-V should be much easier than x86 to ARM as I understand it, so one could conceivably do x86 -> ARM -> RISC-V.
It almost certainly is not. Odds are Apple will eventually remove Rosetta II, as they did Rosetta back in the days, once they consider the need for that bridge to be over (Rosetta was added in 2006 in 10.4, and removed in 2011 from 10.7).
> And I hope what is learned from it can be used to make a RISC-V version of it. translating native ARM to RISC-V should be much easier than x86 to ARM as I understand it, so one could conceivably do x86 -> ARM -> RISC-V.
That's not going to happen unless Apple decides to switch from ARM to RISC-V, and... why would they? They've got 15 years experience and essentially full control on ARM.
Re: Why is Rosetta 2 fast?
#7The main reason, M1/2 being incredibly fast. Is listed last.
If Rosetta ran x86 code at 10% the speed of native nobody would be calling it fast.
Re: Why is Rosetta 2 fast?
#8As a somewhat related aside, I have been watching Bun (low startup time Node-like on top of Safari’s JavaScript engine) with enough interest that I started trying to fix a bug, which is somewhat unusual for me. I mostly contribute small fixes to tools I use at work. I can’t quite grok Zig code yet so I got stuck fairly quickly. The “bug” turned out to be default behavior in a Zig stdlib, rather than in JavaScript code. The rest is fairly tangential but suffice it to say I prefer self hosted languages but this probably falls into the startup speed compromise.
Being low startup overhead makes their VM interesting, but the fact that it benchmarks better than Firefox a lot of the time and occasionally faster than v8 is quite a bit of quiet competence.
Re: Why is Rosetta 2 fast?
#9We have giant corpuses of source code, compiled x86_64 binaries, and compiled arm64 binaries. I assume the compiled binaries represent approximately our best compiler technology. It seems predicting an arm binary from an x86_64 binary would not be insane?
If someone who actually knows anything here wants to disabuse me of my showerthoughts, I'd appreciate being able to put the idea out of my head :-)
Re: Why is Rosetta 2 fast?
#10The main reason, M1/2 being incredibly fast. Is listed last.
- can be told to do total store ordering, just as x86 does
- have of a few status flags that x86 has, but regular arm doesn’t
- can be told to make the FPU behave exactly as the x86 FPU
It also helps that ARM has many more registers than x86. Because of that the emulator can map the x86 registers to ARM registers, and have registers to spare for use by the emulator.