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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Lua vs Ruby benchmarks (similarly "high-level" languages, insanely different performance)

39 点作者 critic超过 16 年前

13 条评论

henning超过 16 年前
LuaJIT is not the standard mainline Lua interpreter that most people think of as "Lua the language". It's still a fairly young, experimental project and you wouldn't want to write production code in it. However, the standard Lua distribution is still much faster than Ruby.<p>But even though both are dynamic interpreted languages, it's still apples to oranges - they have very different design goals.<p>Still, I think it's a copout to say performance doesn't matter in any general-purpose language the way the core Ruby team seems to. Micro-optimization is a waste of time, but efficiency and intelligent implementation choices are necessary.
评论 #459582 未加载
Zak超过 16 年前
Without some discussion of why Lua is faster, this isn't very interesting. Lua is known for being small and fast, so this benchmark shouldn't be news to most people here.<p>SBCL is faster still, averaging about half the speed of GCC and about the same as Java.
评论 #459578 未加载
评论 #459693 未加载
评论 #459055 未加载
评论 #458740 未加载
nod超过 16 年前
I don't know Lua, but this is the first time I've heard Lua and Ruby equated in terms of expressibility/flexibility (i.e. "high-level"?). Is that a particularly relevant comparison?
评论 #458716 未加载
评论 #458714 未加载
评论 #458711 未加载
评论 #459554 未加载
brianm超过 16 年前
Personally, I would hav just done Lua vs Ruby instead of LuaJIT vs Ruby.<p>Results look almost the same ;-)<p><a href="http://shootout.alioth.debian.org/u32/benchmark.php?test=all&#38;lang=lua&#38;lang2=ruby" rel="nofollow">http://shootout.alioth.debian.org/u32/benchmark.php?test=all...</a><p>Lua is generally the fastest scripty language, ruby is generally the slowest. Ruby is much more general purpose though -- Lua is very optimized for embedding.
评论 #458717 未加载
FraaJad超过 16 年前
mod_lua will be in the next stable apache release. <a href="http://lua-users.org/lists/lua-l/2008-12/msg00119.html" rel="nofollow">http://lua-users.org/lists/lua-l/2008-12/msg00119.html</a>
joe_the_user超过 16 年前
Who would care to implement Ruby in Lua?
评论 #459585 未加载
Locke超过 16 年前
Which version of Ruby? 1.8 or 1.9? With my own projects Ruby 1.9 performs much better. Lua is well known for being small and fast, so I doubt Ruby 1.9 would beat it... Nevertheless, it'd be a lot more interesting comparison that Lua vs Ruby ???.
评论 #458899 未加载
rufius超过 16 年前
Looks like perf comparison between both Python and Python 3 against Lua isn't far off from Ruby and Lua... not really surprised. Like everyone else said, Lua is smaller and leaner.
compay超过 16 年前
This year my new year's resolution was to learn Lua. I think with some developer attention it has the potential to become a "better PHP" for web development because it beats PHP in performance, simplicty and elegance.<p>Although I doubt it's going to ever replace PHP I think it's poised to make some inroads now that the next version of Apache will include mod_lua out of the box.<p><a href="http://news.ycombinator.com/item?id=452396" rel="nofollow">http://news.ycombinator.com/item?id=452396</a>
jcapote超过 16 年前
Of course; Get a native JIT'ed version of ruby going, then you can make a fair comparison.
评论 #458750 未加载
评论 #458715 未加载
评论 #459316 未加载
评论 #458707 未加载
Adkron超过 16 年前
Are both sets of code optimized?
zcrar70超过 16 年前
I wonder how it would compare with Ruby 1.9 (released today)?
评论 #458792 未加载
kingkongrevenge超过 16 年前
LuaJIT is x86 only, so it's not quite apples to apples.
评论 #458696 未加载