LLVM JIT可以加快选择速度吗? [英] LLVM JIT speed up choices?

查看:158
本文介绍了LLVM JIT可以加快选择速度吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是一种主观的方法,但是我很难使LLVM JIT达到最高速度.即使打开了懒惰的编译,对大型代码进行jit处理的时间也只是解释它们所花费的时间的50倍.

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?

还有其他建议吗?

推荐答案

很遗憾地说,LLVM作为JIT编译器不是很快,而作为AOT/静态编译器则更好.

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

我在 llvm-lua 项目中遇到了相同的速度问题.我所做的是禁用大型Lua函数的JIT编译. llvm-lua没有启用延迟编译支持,因为LLVM需要太多的C堆栈空间才能从Lua协程运行.

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.

此外,如果您在程序的main()函数中使用此功能,则:

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

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

它将从LLVM中公开很多命令行选项,例如"-time-passs",这将启用LLVM通过的时间,以查看JIT编译的哪些部分花费的时间最多.

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.

这篇关于LLVM JIT可以加快选择速度吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆