|
|
|
|
|
by jonathanyc
1312 days ago
|
|
Awesome that the result is backed by benchmarks. The writing style is very clear and having actual code snippets is great. Favorited! My tldr understanding that: - writing a byte code interpreter in C++ is slow, and a big reason is callee-saved registers / the compiler doesn't optimize well when multiple operations are implemented in the same "giant switch table" function - but it's annoying to write everything in assembly - so the author made a compiler that glues together C++ implementations of byte code instructions (compiled to LLVM IR) into an interpreter, avoiding callee-saved registers (and performs other optimizations) It'd be interesting to see ablation testing for the other optimizations, like fuzing indices into op codes. My bet would be that avoiding having to restore registers dominated of the performance impact--that was the case for the compiler I implemented with friends in college. |
|