TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

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

39 pointsby criticover 16 years ago

13 comments

henningover 16 years ago
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 未加载
Zakover 16 years ago
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 未加载
nodover 16 years ago
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 未加载
brianmover 16 years ago
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 未加载
FraaJadover 16 years ago
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_userover 16 years ago
Who would care to implement Ruby in Lua?
评论 #459585 未加载
Lockeover 16 years ago
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 未加载
rufiusover 16 years ago
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.
compayover 16 years ago
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>
jcapoteover 16 years ago
Of course; Get a native JIT'ed version of ruby going, then you can make a fair comparison.
评论 #458750 未加载
评论 #458715 未加载
评论 #459316 未加载
评论 #458707 未加载
Adkronover 16 years ago
Are both sets of code optimized?
zcrar70over 16 years ago
I wonder how it would compare with Ruby 1.9 (released today)?
评论 #458792 未加载
kingkongrevengeover 16 years ago
LuaJIT is x86 only, so it's not quite apples to apples.
评论 #458696 未加载