TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ruby, Python, "Power"

15 点作者 niels将近 17 年前

1 comment

mdasen将近 17 年前
A mostly good article that shows little regard for reality in the performance section. "Ruby and CPython perform roughly the same." That is correct if you believe that 3x slower is roughly the same (<a href="http://shootout.alioth.debian.org/debian/benchmark.php?test=all&#38;lang=ruby&#38;lang2=python" rel="nofollow">http://shootout.alioth.debian.org/debian/benchmark.php?test=...</a>). They are in the same ballpark (vs. Java or C).<p>If the author had left it at that, fine. He goes on: "It would be surprising if [YARV, the new Ruby VM meant to improve performance] didn't perform better than CPython." That would make sense if CPython and Ruby performed the same, but Ruby is a third as fast as CPython. In order to match CPython, Ruby has a long way to go. Ruby 1.9, using that YARV VM, still lags behind Python (<a href="http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&#38;lang=yarv&#38;lang2=python" rel="nofollow">http://shootout.alioth.debian.org/gp4/benchmark.php?test=all...</a>). Throw in Psyco (an optimized Python JIT compiler) and Ruby 1.9 looks a good 3-4x slower.<p>Python is faster than Ruby in a significant way (3x is significant). Ruby is a great language that I really like. You don't have to stretch its performance characteristics to make a case for the language - especially when raw performance often isn't important at all.