[gambit-list] Gambit Clang C/C++ status and compiler benchmarks?
Marc Feeley
feeley at iro.umontreal.ca
Mon May 7 12:22:06 EDT 2018
> On May 6, 2018, at 10:08 AM, Adam <adam.mlmb at gmail.com> wrote:
>
> What causes this lower speed should likely boil down to that the way Gambit implements trampolines and its whole single host / calling convention model in C, that for some reason LLVM fails to make those exact logics fast.
>
> I deduce that reasoning from the general observation that GCC and LLVM these days generally are in about the same performance ballpark, if the reports I read were correct - my thought then is that LLVM cannot possibly compile all of Gambit's runtime slower than GCC, as those parts of Gambit are fairly similar in nature to other C applications [and so what LLVM would need to optimize should be Gambit's trampolines/single host/calling conventions that LLVM].
>
> Do you think that line of reasoning would make sense?
>
It is possible that the difference in speed is due to clang not compiling the trampoline mechanism efficiently. But this can be due to a variety of underlying issues…
- not optimizing value labels and the “goto *…” statement
- not performing an optimization when the code is too large or irreducible (not having a structured control flow)
- not performing good register allocation when the code’s control flow is unstructured
If you are interested in solving this issue, I suggest you perform some experiments with gcc and clang. It shouldn’t take more than a few minutes. Try compiling your code with and without --enable-single-host . Please report your results back to the mailing list.
Marc
More information about the Gambit-list
mailing list