Is WebVM faster on x86_64 hosts compared to arm64 MacOS hosts?
I am evaluating WebVM as a tool to sandbox a "playground" environment for a internal company compiler tool as it allows us the ability to run unmodified linux-x86 (does it support 64 bit binaries?) binaries which simplifies our execution environment as compared to compiling the compiler to WASM and writing JavaScript bindings.
One concern I have is that the performance is quite poor - but I have only had the chance to evaluate it on an M1 MacBook Pro host so I am wondering if x86 translation is the cause of this poor performance?
Is WebVM faster on an x86_64 host? If so, are there plans to add support for linux-arm64 virtualization so arm hosts can perform better?
1 Reply
CheerpX only supports 32-bt x86 binaries at this time. We do have plan to support the 64-bit ISA as well, but it's not an immediate priority.
The internal codegen is heavily optimized for x64 hosts and Chrome, but we expect the arm64 performance to be roughly similar. There is a very important WebAssembly extension, Branch Hinting, that is standardized but not yet enabled by default on Chrome. You should try again with branch hinting enabled by passing the following command line option to Chrome:
--js-flags="--experimental-wasm-branch-hinting"
. For more information on branch hinting: https://labs.leaningtech.com/blog/branch-hinting
CheerpX is expected to perform quite well for this class of technologies, with a slowdown between 3x to 10x depending on the specific workload.
Also take into account that not all parts of the instruction set are equally optimized. Integer operations have the most sophisticated codegen, while X87 and MMX/SSE is still quite basic.Leaning Technologies Developer Hub
WebAssembly Branch Hinting: From an idea to W3C standard
Around a month ago, the WebAssembly Community Group voted to advance the Branch Hinting proposal to phase 4, effectively recommending its addition to the standard, and the Working Group formally added it to the standard by voting it into phase 5 last week.
This was a big achievement for me, as th...