什么是LLVM?如何用LLVM替换Python VM将速度提高5倍? [英] What is LLVM and How is replacing Python VM with LLVM increasing speeds 5x?

查看:148
本文介绍了什么是LLVM?如何用LLVM替换Python VM将速度提高5倍?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Google赞助了一个开源项目,将Python的速度提高了5倍.

Google is sponsoring an Open Source project to increase the speed of Python by 5x.

无燕子似乎有为什么并发性是一个难题?
LLVM是否可以解决并发问题?
除了多核技术以外,还有其他解决方案吗?

Why is concurrency such a hard problem?
Is LLVM going to solve the concurrency problem?
Are there solutions other than Multi-core for Hardware advancement?

推荐答案

LLVM 是几件事情-一种虚拟机/优化编译器,结合了不同的前端,这些前端以特定语言进行输入并以中间语言输出结果.该中间输出可以与虚拟机一起运行,也可以用于生成独立的可执行文件.

LLVM is several things together - kind of a virtual machine/optimizing compiler, combined with different frontends that take the input in a particular language and output the result in an intermediate language. This intermediate output can be run with the virtual machine, or can be used to generate a standalone executable.

并发性的问题是,尽管它在科学计算中已经使用了很长时间,但最近在消费者应用程序中已经变得很普遍.因此,尽管如何编程科学的计算程序来实现出色的性能已广为人知,但是编写可以精巧并发的邮件用户代理/文字处理器却是完全不同的事情.另外,当前大多数操作系统的设计都考虑到了单个处理器,并且可能还没有为多核处理器做好充分的准备.

The problem with concurrency is that, although it was used for a long time in scientific computing, it has just recently has become common in consumer apps. So while it's widely known how to program a scientific calculation program to achieve great performance, it is completely different thing to write a mail user agent/word processor that can be good at concurrency. Also, most of the current OS's were being designed with a single processor in mind, and they may not be fully prepared for multicore processors.

LLVM在并发方面的好处是您具有中间输出,并且如果将来在并发方面有所进步,那么通过更新解释器,您可以立即在所有LLVM编译的程序中获得这些好处.如果您已编译为独立的可执行文件,则并非那么容易.因此LLVM本身并不能解决并发性问题,但是为将来的增强打开了大门.

The benefit of LLVM with respect to concurrency is that you have an intermediate output, and if in the future there are advances in concurrency, then by updating your interpreter you instantly gain those benefits in all LLVM-compiled programs. This is not so easy if you had compiled to a standalone executable. So LLVM doesn't solve the concurrency problem per se but it leaves an open door for future enhancements.

当然,诸如量子计算机,遗传计算机等硬件还有更多的进步.但是我们必须等待它们成为现实.

Sure there are more possible advances for the hardware like quantum computers, genetics computers, etc. But we have to wait for them to become a reality.

这篇关于什么是LLVM?如何用LLVM替换Python VM将速度提高5倍?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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