V8 下的 Javascript 比其他语言上的同等代码更快吗?
有人知道 V8 上的 Javascript 是否比其他语言(例如 Python、Perl、PHP 等)上的等效代码运行得更快?
Anyone know whether Javascript on V8 runs faster than equivalent code on other languages such as Python, Perl, PHP etc...?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
是的,根据计算机语言基准游戏 ,但是要小心解释人工基准测试的结果。
默认比较是与 Java 进行比较,Java 通常速度更快,但您可以将其与 Perl、PHP 以及一些 Ruby 和 Python 实现进行比较。除了使用大整数的基准测试之外,它似乎大多更快,因为 JavaScript 本身并不支持它们。
Yes, according to the Computer Language Benchmarks game, but be careful interpreting results from artificial benchmarks.
The default comparison is to Java, which is generally faster, but you can compare it to Perl, PHP and several Ruby and Python implementations. It seems to be mostly faster except in the benchmarks that use big integers, because JavaScript doesn't support them natively.
这取决于应用程序。在相同的特定情况下,从长远来看,它比 GCC/C++ 更快。
http://wingolog.org/archives/2011/ 06/10/v8-is-faster-than-gcc
It depends of the application. In same specific cases it's faster than GCC/C++ in the long run.
http://wingolog.org/archives/2011/06/10/v8-is-faster-than-gcc
不。从性能角度来看,没有人可以击败由专家编写的(例如 Node.js)实现,该专家花了一年时间在汇编器中实现它,重点是性能(由基准和计时信息支持,这些信息在发布版本),适用于特定架构和特定数据文件。
当然,瓶颈在于下载程序,而不是实际的运行时性能,但是,考虑到其大小,手工制作的汇编程序仍然很难被击败。
No. Nobody can beat, performance wise, an implementation of (eg, Node.js) written by an expert who has spent a year implementing it in assembler, with a focus on performance (backed by benchmarks and timing information, which is removed in a release version), for a particular architecture and particular data file.
Of course, the bottleneck is downloading the program, not in the actual runtime performance, however, hand-crafted assembler would still be very hard to beat given its size.