Francis Cianfrocca wrote:

> I agree with Kirk. Ruby's inherent performance bottleneck is also its most
> distinctive feature: the open classes and data structures. There's always
> going to be a limit to how much faster you can do name-resolution at
> runtime, since it's costly to begin with, and you can't deterministically
> predict it. (There are approaches to adaptively predict name-bindings at
> runtime, notably from Smalltalk, and I expect JRuby will be able to leverage
> them. But they can ameliorate, not solve, the fundamental issue.)

Which is why they teach data structures in computer science class. It's 
all about fast search, I think. That's one of the big gripes I have with 
"lazy" interpretation. If you don't do stuff until you have to do it, it 
only pays off if you end up *never* having to do it. :)

[snip]

> I used to believe that large Ruby programs could be constructed as
> independent coarse-grained modules running in their own processes,
> communicating through message-passing. Having done quite a bit of this now,
> I think the approach helps quite a bit, but still suffers from memory usage.
> It's hard to get the memory-usage of even a small Ruby program down to a
> level that would permit (perhaps) hundreds of cooperative processes to be
> running at once.

And unless the Ruby "inner interpreter" is highly optimized, even if you 
have only one copy of the text segment and only one copy of all the 
libraries in RAM, you're *really* unlikely to have all the "good stuff" 
in the tiny caches processors have.

> Bottom line: using Ruby will always be characterized by a tradeoff between
> performance and programmer productivity. This is not a criticism of Ruby in
> any way, shape or form! Productivity is a fundamental engineering value, and
> time-to-market is a fundamental quality dimension. Ruby therefore has, and
> will continue to have, a unique value proposition.

I'm not sure this is a valid tradeoff. The economics of *development* 
and the economics of *operating* a large code are two entirely different 
subjects. People have "always" prototyped in "slow but productive" 
languages, like Lisp, Perl, PHP and Ruby, and then reached a point where 
the economics dictated a complete rewrite for speed into C, C++ or Java. 
I can think of more examples of this than I can of something that was 
developed and prototyped rapidly and then grew by "just throwing more 
hardware at inefficient software."

So ... just like a startup should plan for the day when a big company 
offers them the choice of selling out or being crushed like a bug, when 
you implement a great idea in some rapid prototyping framework like 
Rails, plan for the day when you are offered the choice of rewriting 
completely in a compiled language or going bankrupt buying hardware.