Skip to content
HomeVideosBooksBlogs
AllTop postsTopics
Podcasts
HistoryListsWatch laterLiked videosFollowing

The videos, books, blogs and podcasts Hacker News keeps recommending, all in one place.

VideosBooksBlogsPodcastsAboutPrivacySettings

Data from Hacker News, HackerTube, HackerBooks, HackerBlogs and Open Library. Credits · Not affiliated with Y Combinator.

HomeVideosBooksBlogsPodcasts
Ctrl K
    C

    Charles Nutter

    blog.headius.com · Personal blog · on HN since 2008

    Charles Nutter (headius), a JRuby lead, writes about Ruby implementation, JVM optimization, and invokedynamic.

    Visit blogRSSHN submissions
    Languages & CompilersSystems & Performance
    What HN says

    Commenters cite his posts on why Ruby features like refinements are hard to optimize and call them great articles on language optimization.

    Stats for nerds
    74HN people shared it
    63linked in comments
    1.9Kstory points
    Jun 2017last shared
    2009people per year2017

    Top posts on HN

    1. 1
      My Thoughts on Oracle v Google
      2 people · 606 points · first shared 2010 · 82 comments on HN
    2. 2
      Running JRuby on the Graal JIT
      1 person · 173 points · first shared 2018 · 36 comments on HN
    3. 3
      Refining Ruby
      9 people · 168 points · first shared 2012 · 54 comments on HN
    4. 4
      So You Want To Optimize Ruby
      4 people · 126 points · first shared 2012 · 39 comments on HN
    5. 5
      JRuby Creator's Short List of Key Missing JVM Features
      2 people · 124 points · first shared 2010 · 37 comments on HN
    6. 6
      On Languages, VMs, Optimization, and the Way of the World
      4 people · 93 points · first shared 2013 · 29 comments on HN
    7. 7
      Creating beautiful charts with JRuby and JFreeChart
      1 person · 67 points · first shared 2025 · 25 comments on HN
    8. 8
      Introducing Surinx (Ruby syntax w/ Java typing)
      1 person · 51 points · first shared 2009 · 32 comments on HN
    9. 9
      An experiment in static compilation of Ruby: FastRuby
      1 person · 50 points · first shared 2012 · 25 comments on HN
    10. 10
      The future of java
      1 person · 37 points · first shared 2009 · 14 comments on HN

    What HN people wrote when they linked it

    • jpedrosaApr 2009

      Sure... Nice write-up.

      From the Hacker News site I have been following the recent controversy and even participated in some discussions. :-) Your Honor, I plead guilty! :-)

      I cannot blame them (Twitter) when they seek their goals for a better business with higher quality and performance. I even respect their creative skills. So I don't have a beef with them even when Ruby gets caught in the polemic.

      Ruby to this day continues to be an open source project put together by a community that for better or for worse has most core developers being Japanese.

      But since about 3 or 4 years ago, Ruby has had other developers seeking to implement compatible Ruby versions... That is, Ruby has outgrown itself and continues to do so. JRuby, MacRuby, Rubinius, IronRuby...

      At the end of it, though, Ruby continues being relatively slow when compared to other kinds of languages. But first read the following article to see some reasons why is that:
      http://blog.headius.com/2009/04/how-jruby-makes-ruby-fast.html

      Since Ruby's beginning, it was not out to reach C level performance. And JRuby for one improves upon some of the shortcomings of the main C implementation of Ruby quite well, not without its own shortcomings though. :-)

      So, what do we have in the controversy? Twitter is a little sick of complaints of it letting the ball fall when much more is required of their services, so they go overboard when defining a solid platform for it with Scala. Not to mention that they simply can't go…

    • headiusJul 2010

      I can comment on the JRuby results.

      For the base perf numbers, I'm not surprised. We've known that we're roughly on par with 1.9.2 for some time, and many of the benchmarks in question have started to reach a point of irreducible complexity (e.g. you can only slice and dice strings so fast). It's good to see JRuby remains at or near the front of the pack as far as performance, especially considering we've made no major performance-related changes in almost two years.

      The Linux versus Windows numbers are a bit surprising to me. If I were to make a guess, I'd guess that the JVMs used were not identical (perhaps like Isaac Gouy mentions, one platform was 64-bit and the other wasn't) or some other detail altered the performance characteristics of the test. But the performance drop does seem to be in line with other implementations, so perhaps Windows really does suck and there's not much we can do about it.

      On the memory issue, I have a few recommendations.

      JRuby by default allows the JVM to use up to a 512MB heap (the default is usually 32-64MB, which is rarely enough for most nontrivial apps). The JVM likes to use as much memory as you're willing to give it, to keep GC times low (nearly free) and to give it lots of room to breathe. Almost all these benchmarks could run in far less memory (maybe 1/5 as much or lower) if the JVM were choked down to that level. So it's not surprising to me that the memory sizes for these very object and CPU-intensive benchmarks start to…

    • stephenjudkinsOct 2011

      There are a few reasons one might choose to use JRuby.

      The most frequently cited reason is to take advantage of JRuby's generally quite excellent Java interoperability. In many cases it may be the best way to introduce Ruby into an organization with a large, legacy Java codebase. Further, despite its oft-maligned reputation, Java still offers the largest number of high-quality, performant FOSS libraries of any platform. In our case, we are developing a Rails application along with a supporting Scala library simultaneously. In my experience, JRuby/Java/Scala integration is largely painless.

      Further, JRuby could legitimately be considered the best Ruby implementation. It's very rare to find pure Ruby code that works on any other Ruby implementation but not JRuby. JRuby is, in general, faster than Ruby 1.9 (and in almost all cases much faster than 1.8). Further, upcoming enhancements in JDK 7 may allow some very impressive speed-ups (see http://blog.headius.com/2011/08/jruby-and-java-7-what-to-expect.html).

    • jimbokunApr 2009

      This linked article:

      http://blog.headius.com/2009/04/how-jruby-makes-ruby-fast.html

      is really outstanding. It shows you exactly why a language like Ruby is inherently slower than a language like Java. Mainly, because Ruby does a lot more work to give you the cool, dynamic capabilities that make people like Ruby in the first place. Of course, much of the cool work on speeding up dynamic languages like Javascript and Ruby is all about analyzing code to find places where you can safely make assumptions about the code (+ is not overridden here, so I can use the built in integer addition operator, etc.).

      (I probably oversimplified that, but I hope it captures the general idea.)

      The "Duby" language at the end makes me think of Common Lisp and how you can optionally declare types the compiler can use to compile faster code. Would it be worthwhile to add optional typing to Ruby?

    • rohitarondekarNov 2012

      (1) Syntax wise Ruby is a lot easier and more expressive than Scala. IMHO I feel that Ruby is an OO language with some functional sprinkles while Scala is a functional language with OO sprinkles.

      (2) Ruby has a great ecosystem if you are building web apps. It's also got a lot of testing libraries. :) But in seriousness the number of libraries in non web/tooling space is slowly increasing as faster Ruby implementations have become a focus point. Also JRuby allows you use the vast ecosystem of Java from within JRuby.

      (3) Performance wise I'm pretty sure Scala will outperform Ruby. I don't think JRuby will be able to compete either. Charles Nutter, JRuby Core developer wrote this blog post which explains why Ruby is hard to optimize ― http://blog.headius.com/2012/10/so-you-want-to-optimize-ruby.html

      Of course take everything I've said with a bag of salt! :)

    • theblueskyJul 2012

      The point my original post makes is that .NET having concurrent GC is not exactly groundbreaking. This doesn't have anything to do with the so-called expressiveness of C# relative to Ruby.

      >The bytecode language is not standardized, and there is no standard assembler language for it

      There is a formal spec here:
      http://docs.oracle.com/javase/specs/jvms/se7/jvms7.pdf

      > New features to the JVM are only added when they are required for Java.

      This is another false assumption:
      http://blog.headius.com/2008/09/first-taste-of-invokedynamic.html

      >I say it does rival [the expressiveness of] ruby, you say it doesn't, good discussion.

      Not really, is more like a generally accepted fact. e.g. Ruby typically uses 2-3x less code than C# to do the same thing:
      http://shootout.alioth.debian.org/u64q/benchmark.php?test=all&lang=csharp&lang2=yarv

    Related

    Cay Horstmannhorstmann.com32 people

    Java in the Small

    Cay Horstmann
    Personal · last shared 2026
    John Wiegleynewartisans.com49 people

    Monads in pictures

    John Wiegley
    Personal · last shared 2026
    JRollerjroller.com72 people

    Time for a return of the Cypherpunks, Crypto-Anarchists & Techno-Libertarians?

    JRoller
    Publication · last shared 2017
    Jason Moironjmoiron.net36 people

    Go Performance Tales

    Jason Moiron
    Personal · last shared 2026
    GraalVM Blogmedium.com/graalvm58 people

    Writing memory safe JIT compilers

    GraalVM Blog
    Company · last shared 2026
    Tobias Pfeifferpragtob.wordpress.com41 people

    Elixir Gotchas

    Tobias Pfeiffer
    Personal · last shared 2026
    Cliff Clickcliffc.org23 people

    Introverts, Emotional Processing, Self-Esteem and Salary Negotiations

    Cliff Click
    Personal · last shared 2019
    Mislav Marohnićmislav.uniqpath.com100 people

    Vim: revisited

    Mislav Marohnić
    Personal · last shared 2015