Hacker News new | ask | show | jobs
by s-macke 1331 days ago
Can you explain in more detail how this recompilation works? When is it triggered? Because your emulator is still very slow, and recompiling doesn't seem to help. A wiki or blog post would be helpful.
1 comments

Yes, I should write about v86's internals some day. Meanwhile, the code is right here: https://github.com/copy/v86/tree/master/src/rust

It's much faster with recompilation than without, but I agree that it's slower than expected (compared to, for example, qemu-tcg).

There is still room for improvements (e.g. eflags updates, 16-bit instructions, call/ret optimisations, main loop), but part of the problem is limitations of web assembly (no mmap, only structured control flow) and browser engines (memory blow up on large generated wasm modules, related to control flow).

The webvm folks explain the control flow problem quite well, and seem to be doing a better job than v86: https://medium.com/leaningtech/extreme-webassembly-1-pushing...