Insights into performance of tail calls.
Closed this issue · 1 comments
I'm trying to follow up on the following articles:
- https://leaningtech.com/blog/2020/08/18/extreme-webassembly-2-the-sad-state-of-webassembly-tail-calls/
- https://leaningtech.com/blog/2022/07/11/fantastic-tail-calls-and-how-to-implement-them/
Currently, Firefox/SpiderMonkey landed Wasm tail calls patches. And I was pleased to see https://webvm.io/ works (it loads/runs different cxcore.wasm), but cannot find any details on why tail calls are important for performance of x86 virtualization. More specifically, there is a need to construct simple benchmarks for this specific use case. Can you provide couple of pointers on how to build these?
Running webvm in Firefox Nightly with tail calls enabled/disabled I see about the same numbers by running time python3 examples/python3/fibonacci.py
. Am I doing it wrong?
Thank you.
Tails calls are important to efficiently implement indirect jumps, we wrote an extensive write up on the matter that you might have missed.
Since the time the blog post was written we have implemented quite a few improvements in CheerpX that mitigate the impact though, in particular we figured out a technique to make the indirect jump on library calls less of a problem.
Closing since this repository is about Cheerp (C++ to WebAssembly/JavaScript compiler), not about CheerpX (x86 on Wasm VM and JIT). For further discussion consider joining our discord: https://discord.gg/yTNZgySKGa