4 ms·
QEMU is shockingly excellent. Do not extrapolate, but one piece of code I was working on ran at a 1/4 of the speed in RISC-V under QEMU compared to the host.
by FullyFunctional 6y ago
QEMU is shockingly excellent. Do not extrapolate, but one piece of code I was working on ran at a 1/4 of the speed in RISC-V under QEMU compared to the host. That's a really amazing result.
- zozbot234 6y agoMuch of that is due to RISC-V being quite emulation-friendly as far as ISA's go. You wouldn't guess that given e.g. the weird encoding of insn operands, but that turns out to be a minor factor in practice.
- FullyFunctional 6y agoAbsolutely. QEMU is JITting so decode is only done once. What helps here is the absence of crazy semantics, like flag updates. Some things are still expensive, such as indirect branches (jalr), virtual memory translation (load/store), and handling RISC-V's 31 registers without hitting memory for each of them (the host ISA, x64, has only 16 architectural registers).