LLVM JIT speed up choices?

我只是一个虾纸丫 提交于 2019-12-05 18:00:11

问题


It's kind of subjective, but I'm having troubles getting LLVM JIT up to speed. Jitting large bodies of code take 50 times as much time as just interpreting them even with lazy compilation turned on.

So I was wondering how can I speeding jitting up, what kind of settings I can use?

Any other recommendations?


回答1:


I am sorry to say that LLVM just isn't very fast as a JIT compiler, it is better as a AOT/static compiler.

I have run into the same speed issues in my llvm-lua project. What I did was to disable JIT compiling of large Lua functions. llvm-lua doesn't have lazy-compilation support turned on since LLVM requires too much C-stack space to run from Lua coroutines.

Also if you use this in your program's main() function:

llvm::cl::ParseCommandLineOptions(argc, argv, 0, true);

It will expose alot of command-line options from LLVM like '-time-passes' which will enable timing of LLVM passes, to see which parts of the JIT compiling is taking the most time.



来源:https://stackoverflow.com/questions/4077396/llvm-jit-speed-up-choices

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!