Get the latest tech news
Parsing protobuf at 2+GB/s: how I learned to love tail calls in C (2021)
An exciting feature just landed in the main branch of the Clangcompiler. Using the [[clang::musttail]] or__attribute__((musttail)) statement attributes, you ...
Theoretically, this control flow graph paired with a profile should give the compiler all of the information it needs to generate the most optimal code. The only opportunity for improvement I see here, aside from the jne fallback issue mentioned before, is that for some reason the compiler doesn’t want to generate jmp qword ptr [rsi + 8*rax]. We have not yet implemented this fallback in upb, but I expect it will involve a macro that either tail calls to dispatch or just returns, based on the availability of musttail.
Or read this on Hacker News