Hacker News new | ask | show | jobs
by LekKit 1196 days ago
Basically there are few design choices where it's substantially different to QEMU.

Performance-wise:

- Instead of a static translate-and-run flow like in QEMU, RVVM has an interpret-trace-run execution loop which is remotely similar to JVM, and allows to collect some data like branch probabilities and hot loops, and optimize better

- Using a hardware host FPU instead of softfp emulation. This is like, 10x faster with some synthetic FPU benchmarks

- Conscious decisions for beneficial trade-offs, like fast-path JIT trace cache, JIT IR is more streamlined to "Big ISA Triad" (RISC-V, ARM64, x86-64), etc

Infrastructure-wise:

- A public library API for a lot of things: Machine management (Construct and run 'em in any program), device integration, registering new CPU instructions, userspace emulation

- Subjectively, a more lean and clean codebase, in places where it wasn't harmed by either 1) performance decisions to copy-paste or restructure things 2) complexity of related things like JIT backend arches

- Portability. RVVM officially runs in WASM, runs on Haiku, SerenityOS, KolibriOS, even DOS!

So yeah, while I can't say for sure it's the fastest RISC-V VM, but if we had a bunch more contributors and a bit more popularity it could definitely take a part of the QEMU crown (For things like distro building and god knows what else).

There are a few other differences here & there, but they aren't as much worth mentioning. Do you believe I should make some kind of QEMU/RVVM comparison anywhere in the repo? It seems kind of selfish to present it like that...