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.

Ruby 2.6.0-preview2 released with JIT

306 pointsby 15DCFA8Falmost 7 years ago

12 comments

pjungwiralmost 7 years ago
Congratulations Ruby team! I&#x27;m excited to hear about the performance improvements. It seems like JIT could be a huge win since calling a method requires checking all kinds of possibilities that are almost always not used, but might be. I would love to keep all the power &amp; fun of Ruby without worrying so much about performance.<p>Speaking of optimizing method calls: now that it&#x27;s been a few years, I wonder what Ruby folks think about refinements. Are you using them? Are they helpful? Horrible?<p>I remember reading from the JRuby folks that refinements would make Ruby method calls slower---and not just refined calls, but <i>all</i> method calls [1], although it sounds like that changed some before they were released [2]. It seems like people stopped talking about this after they came out, so I&#x27;m wondering if refinements are still a challenge when optimizing Ruby? I guess MRI JIT will face the same challenges as the Java implementation?<p>[1] <a href="http:&#x2F;&#x2F;blog.headius.com&#x2F;2012&#x2F;11&#x2F;refining-ruby.html" rel="nofollow">http:&#x2F;&#x2F;blog.headius.com&#x2F;2012&#x2F;11&#x2F;refining-ruby.html</a><p>[2] <a href="https:&#x2F;&#x2F;github.com&#x2F;jruby&#x2F;jruby&#x2F;issues&#x2F;1062" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;jruby&#x2F;jruby&#x2F;issues&#x2F;1062</a>
评论 #17223986 未加载
评论 #17223965 未加载
评论 #17222322 未加载
评论 #17226297 未加载
hirundoalmost 7 years ago
&gt; Add a new alias then to Kernel#yield_self. [Feature #14594]<p>It might seem strange that they lead with this new feature, but `yield_self` can greatly improve the Ruby chainsaw, and `then` makes it more accessible.<p>The style of writing a Ruby method as series of chained statements has a non-trivial effect on readability and conciseness. `then` lets you stick an arbitrary function anywhere in the chain. They become more flexible and composable, with less need to interrupt them with intermediate variables that break the flow.<p>I&#x27;ve been using `ergo` from Ruby Facets for years ... largely the same thing ... and the more I used it the more readable I find my old code now. Funny how adding one very simple method can have more effect than so many other complex, high effort changes.
评论 #17221931 未加载
评论 #17221928 未加载
shoalmost 7 years ago
&gt; We’re going to implement method iniling in JIT compiler, which is expected to increase Ruby’s performance in order of magnitude<p>An order of magnitude as in .. 10x? This seems too good to be true. Half the arguments against Rails melt away like butter if that&#x27;s truly the case.<p>Anyone with a better understanding of the details care to comment on the likelihood of these performance gains being actually realised, and if not, what we might realistically expect?
评论 #17220967 未加载
评论 #17220871 未加载
评论 #17228675 未加载
virtualwhysalmost 7 years ago
@darkdimius[0], the person who tweeted the referenced tweet in the article, was arguably the primary contributor to Dotty[1] behind Martin Odersky (Dotty will be Scala 3, the next major version of the language).<p>Once he finished his doctorate at the EPFL, off to Stripe he went, bye bye Scala. Tough industry, on the one hand Scala benefits from a revolving door of high level EPFL doctoral students, and on the other the talent pool shifts around as students come and go.<p>Money talks, companies like Stripe have a leg up in that they can fund full-time engineers to work on projects, whereas institution backed projects typically have a much smaller pool of long-term engineers to rely on (JetBrains, for example, has something like 40 full-time engineers working on Kotlin&#x2F;KotlinJS&#x2F;Kotlin Native).<p>[0] <a href="https:&#x2F;&#x2F;github.com&#x2F;DarkDimius" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;DarkDimius</a> [1] <a href="https:&#x2F;&#x2F;github.com&#x2F;lampepfl&#x2F;dotty" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;lampepfl&#x2F;dotty</a>
alberthalmost 7 years ago
What’s the current sentiment as for what will ultimately lead to the best performance of executing Ruby?<p>From my uneducated perspective, seems like Graal VM could become the de facto Ruby deployment stack.<p><a href="https:&#x2F;&#x2F;github.com&#x2F;oracle&#x2F;truffleruby" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;oracle&#x2F;truffleruby</a>
评论 #17222665 未加载
评论 #17221503 未加载
wwarneralmost 7 years ago
A standardized AST! That&#x27;s a big win.
评论 #17220756 未加载
ksecalmost 7 years ago
There is another announcement from RubyKaigi 2018 related to performance.<p>Rubex - A Ruby-like language for writing Ruby C extensions.<p><a href="https:&#x2F;&#x2F;github.com&#x2F;SciRuby&#x2F;rubex" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;SciRuby&#x2F;rubex</a>
himomalmost 7 years ago
I wish though, that except for eval and exec, that the majority of Ruby code could get an incremental&#x2F;LTO JIT similar to HotSpot and a GC like C4 rather than an inc gen GC.
blattimwindalmost 7 years ago
&gt; Unlike ordinary JIT compilers for other languages, Ruby’s JIT compiler does JIT compilation in a unique way, which prints C code to a disk and spawns common C compiler process to generate native cod e.<p>Oh dear god.
评论 #17220741 未加载
评论 #17220742 未加载
评论 #17220957 未加载
评论 #17220686 未加载
评论 #17220763 未加载
评论 #17220683 未加载
评论 #17220729 未加载
karagalmost 7 years ago
why ruby innovate and not python ?
评论 #17220931 未加载
评论 #17220704 未加载
评论 #17222569 未加载
jaequeryalmost 7 years ago
I wonder if Matz may consider even just adopting Crystal in the future, considering it is almost 99% compatible with Ruby and has 10x-20x performance gains out of the box.
评论 #17221345 未加载
评论 #17222357 未加载
stevebmarkalmost 7 years ago
Everything in Ruby happens at runtime. Even the definition `class X` becomes a runtime `Class.new` invocation. It&#x27;s imperative from the inside out. Even a JIT is compiler won&#x27;t and can&#x27;t solve the fundamental flaws permanently baked into the language. If you want performance, Ruby probably shouldn&#x27;t be the first tool you reach for.
评论 #17221532 未加载
评论 #17221524 未加载