Zed and Luis drop the bomb on Ruby's poor performance

you make good points - but let me just throw in my 2 cts:

virtual machines are stupid. java is slow. c++ is slow. python is slow.
ruby is slow. so what. if you want fast you need c or fortan or
assembler.
all three are very easy to call from ruby. i use mmap, narray, gsl,
ruby/dl,
ruby queue to cluster and other combos to process GB sized images on a
routine
basis. people are doing real-time video processing with ruby using a
similar
approach. the key to speed is c, not a vm and, if you ask me, that quest
is
the white elephant - not ruby's speed. projects like ruby2c, ruby-inline,
ruby/dl, swig - those are the way to speed.

Makes sense. But.
I'd like to think about things like "reasonable slow" and "unreasonable
slow"; and Ruby sometimes is just __unreasonable__ slow. Here are some
examples:

* I'm working with custom UI library, which is based on HTML (namely, on
terrainformatica.com/htmlayout). There are a large amount of objects created
corresponding to DOM tree nodes ("large" means thousands) and profiler says,
that one of the slowest operation is Class#new - is it normal?

* 5000 objects is loaded from database (by SELECT'ing and setting fields).
The major slower is that each object has Date field (Integer#gcd is very
slow). Or Kernel#send (I use it because of my DSL created) and so on.

Summarizing, after large profilings and optimizations, there are oftenly
some core methods (even Fixnum#+) show themselves as major speed problems.

This situation I call "unreasonable slow".

-a

Victor.

···

From: ara.t.howard@noaa.gov [mailto:ara.t.howard@noaa.gov]

Ara, do you not see value in a Ruby VM, or is just that speed is not, in itself, a justification for a VM?

(The speed-related advantage to a VM is that it does not require one to know C, etc., or have a compiler for all target platforms. Maybe not as fast as tight compiled C, but also not as much trouble. It's a trade.)

···

ara.t.howard@noaa.gov wrote:

... you make good points - but let me just throw in my 2 cts:

virtual machines are stupid. java is slow. c++ is slow. python is slow.
ruby is slow. so what. if you want fast you need c or fortan or assembler.

--
James Britt

"You harmonize; then you customize."
  - Wilson Pickett

Peter Hickman wrote:

[...] The truth is the performance is an issue for Zed and Luis and
they are trying to make out that it is not their personal bugbear but
some sort of conspiracy so they don't look like whiners. [...]

Nice comment Peter!

My comments aren't "look, I cannot code a good program... blame ruby for
its poor performance"

Ruby do his job, and do it well (as I said in the interview)

I work with special MPEG2 playback hardware, some of them analog only,
others with digital interface (ASI-DVB)

Even that I like ruby, cannot use to interface that hardware, mostly
because the quantity of computation needed in the results turns ruby in
a slow, memory comsuming pig.

I don't say that YARV and later a JIT compiler will solve this, but will
provide better performance in general.

I came from a Python background, and ruby was "slow" compared to it
(http://shootout.alioth.debian.org/gp4sandbox/benchmark.php?test=all&lang=ruby&lang2=python\)

But I when come to programing speed (or performance) Ruby wins.

Yes we wouldn't say no to better performance but we (the Ruby community)
are not being held back by the current level of performance.

As another community member, I agree with you... thats why I keep
working in Ruby :slight_smile:

Later,

Luis

···

--
Posted via http://www.ruby-forum.com/\.

Please don't get me wrong, I really like Ruby. However, just because
*I* like Ruby doesn't mean that I can start using it to develop
applications within our corporation (I work for a large corporation).
When I brought up using Ruby for application development with my
senior IT manager, he was concerned about:

(1) Performance: Here, the question is NOT about 'how fast should Ruby
be', but is about what people who have the capacity to make
'significant' corporate decisions are 'being told' about Ruby's
performance by consultants. I have seen presentations by
'well-established' consulting companies that show Ruby's performance
to be an order of magnitude slower than Java for web apps. I don't
have time to develop benchmark tests comparing the two languages, but
have to depend on Ruby app. developers to produce those benchmarks;
unfortunately I cannot find them easily. Now, Zed (I would consider
him an authority on Ruby) comes out and talks about performance issues
with Ruby (and YARV will solve it in the future). How am I now to
convince my manager that Ruby is 'better' (within the context of
performance)?

The reason why IT managers want 'performance' even if the application
*really* doesn't require it, is to cover their behinds, among other
thing. For example, if the website is slow, they don't want it to be
attributed to the language, even if that is not the case (could be a
network problem, but the network group would more willingly point
their fingers at the app. development group for their choice of
language than to accept their problem); has happened before and will
happen again.

So, here 'performance' is not for the sake of performance demanded by
the application, but for the sake of 'not wanting to be talked to by
the boss'. That is the reason I said that many IT managers make
'performance' decisions based on 'feelings', not necessarily had data.

(2) Using two different languages for different performance needs:
Some fellow Rubyists have said that they would switch to C if their
app. needed performance boosts. This will work if it is a personal or
small project. But when in an large corporation, switching between
languages to get performance gains will result in maintenance
nightmares. Many IT managers understand this and have experienced
this. Combined that with the mantra 'Java is fast' preached by many
consultants, and the decision for the senior IT manager becomes easy:
one language that can be used for apps that require *real* performance
and for ones that don't: Java.

(3) Survival of Language: This is another bigee. If the IT manager OKs
a language that happens to be a fad, then he might as well bid goodbye
to his job (lost productivity, cost, etc). So, they want to be sure
that the language is going to be in the 'main stream' for a long time.
In their mind, the only way they can be assured of that is:
       (a) if a large corporation is going to support it -- not
necessarily the language, but any application build using the
language. The thinking goes that if a large corporation is going to
put its weight behind the language, then that corporation will not let
the language die. This is what I meant when I said 'lack of corporate
support for Ruby on Rails'; I don't mean to belittle the corporations
that are offering support for Ruby on Rails, but I am talking from a
large corporation's point of view. A good case study would be on how
Linux got its foot hold into the corporate world.

Once again, if Ruby's vision is *not* to penetrate the corporate
environment as Ryan pointed out (but would be a nice validation if it
indeed penetrate the corporate world by *some* means), then this
discussion is moot. Knowing that, I wouldn't try to push Ruby to my
managers; I will use it for personal projects.

On the other hand, if Ruby has a dream of penetrating the corporate
world, then it needs a marketing machine that would deal with the real
and, more importantly, the 'illusionary' problems created in the
corporate world -- just like Firefox's or Linux's marketing machine.
Unfortunately, penetrating the corporate world by *some* means is
never going to happen, unless an concerted effort is made.

Just some thoughts from a guy who has been in the IT hot seat before,
and is glad he is no longer there!

Sorry for this long post.

-Madan.

···

On 5/22/06, Kirk Haines <khaines@enigo.com> wrote:

The thing that always stands out to me in these performance discussions is
that people argue that Ruby needs a performance improvement, but there are
rarely any specifics attached to that analysis.

How much of speed improvement? How fast should Ruby be? For what?

Hey Peter, thanks for deliberately ignoring my whining. Now, if you'll
excuse me I have to go and continue to security audit the C extensions
in Mongrel so that I can be sure there's no buffer overflows.

Man, if only Ruby were faster. Then I wouldn't have to write so much
stuff in C and could just worry about crafting beautiful code. Oh well,
back to work on my C .... I mean Ruby ... program.

···

On Tue, 2006-05-23 at 01:32 +0900, Peter Hickman wrote:

The problem is that Zed and Luis make out that performance is something
that the whole Ruby community is deliberately ignoring. This is not the
case, there are plenty of people who have no issue with the performance
of Ruby. The truth is the performance is an issue for Zed and Luis and
they are trying to make out that it is not their personal bugbear but
some sort of conspiracy so they don't look like whiners. I have never
though "damn Ruby's dismal performance, it should be able to do this
faster" and I probably never will.

--
Zed A. Shaw

http://mongrel.rubyforge.org/

The elephant in the room is that programmers can't put the importance of execution speed into perspective :slight_smile:

There isn't a lot of discussion on the Ruby list because execution speed isn't the biggest issue for most people.

However, when execution speed *is* an issue it can be a bad bad thing.

···

---

Anyhow, here are a few random thoughts (with some real numbers) around the issue.

---

First off. Premature optimisation. We've all heard of it, even heard that's it is bad. Okay. Quick quiz. Which loop is faster?

#1
for i in 1..(a.length - 1) do
   ... do something to a[i]
end

or

#2
a.each { | thing | ... do something to thing }

or

#3
for thing in a do
   ... do something to thing
end

??

In Ruby 1.6.x #1 was a bit faster than #3 which was a lot faster than #2

(When I replaced the 'each' loop form in xampl-pp -- an XML pull parser that I wrote -- with the 'for ... in' loop form the throughput of the parser was increased by 2-4 times).

In Ruby 1.8.4, #3 is about 15% faster than #2 which is quite a lot faster than #1

(So, I know how to speed up my parser, but I have not done this yet... it is working well enough and because the real speed up is to go to libxml or something).

So. What happened? What we consider to be idiomatic Ruby is now only a little slower than non-idiomatic Ruby. What would have happened if the community had *really* regarded execution speed as a primary criteria? We'd have a different idea of 'idiomatic' is what.

Ruby's focus is on something other than performance.

---

So what happens when speed is important and you've already optimised your algorithms? These days you move out of Ruby. That's your only option. I thank Zed for doing that with Mongrel -- it makes a big difference.

Would a VM have helped? Sure. Sufficiently? I doubt it. Java is what, ten times faster than Ruby? Lets say. Is that sufficient to actually solve the problem?

Not for a lot of the examples that come up.

Definitely not for me.

---

Here's an example. I've got a system written in Rails that is a kind of multi-user authoring tool that runs as a webapp. My customers build multiple inter-dependent websites using it. Publishing takes anywhere from 7 to 45 seconds. This is Rails we are talking about here... nobody gets to do anything while that publishing is going on. There are a number of ways to alleviate the problem (in particular async publishing using DRb or something like that).

Thing is, I got bored last weekend and decided to re-write the main culprit in Common Lisp. I'm using the liquid templating system because it is simple, my customers like it, and you can't change any data when using it. But it is slow (with respect to my applications requirements) -- I *still* *recommend* it. Common Lisp is roughly the speed of C++, maybe a tad faster these days (actually, on OS X with that obnoxious gcc 4.x error that prevents compiling at higher optimisation levels than O1, CL is quite a bit faster than C even -- but lets not go there). The CL version of liquid was more than 120 times faster than Ruby -- and I did *nothing* to optimise the code. That's publishing in less than 0.4 seconds in CL, 45 seconds in Ruby, and lets be generous, 4.5 seconds in Java. Java doesn't solve my problem. I doubt a VM for Ruby would either.

What am I going to do? Well, first off, async publishing using DRb. If I still have a problem I'll rig up something with CL. No, I'm not going to jump straight to CL (and just to be crystal clear here, I like CL just fine, and I like Ruby just fine -- I've just got other higher priority things than raw execution speed to consider).

---

Lets talk a little more about webservers. I've written a lot of Java based web applications over the years. I had a new webapp I had to write and I was more than a little concerned with performance in Java. I had prototyped something but it was horribly complex trying to minimise page generation (it was a completely dynamic site, also involving the construction of multi-page websites). So I wrote the thing in Common Lisp in the end. Two things: first, it generated the pages so quickly I didn't have to optimise anything, it was quicker to just re-generate; second, I used TBNL (slightly modified lisp framework) to serve the web-pages -- it was able to sustain about 70M/s in CL vs about 15k/s in Java (I thought I was going to have a heart attack, that's more than 4500 times higher throughput).

What's the point? Well, that how you do things can be pretty important. RoR is roughly the same throughput as my java applications have been -- even using Webrick, and Mongrel is faster still -- assuming no long-running operations. Also, I still don't do everything in CL.

---

The trouble with Ruby is that there are situations where some low-level operation is being executed so often that it becomes the problem. For example, my XML parser string manipulation is the main consumer of time -- lots and lots of calls to pretty quick methods (Sam Roberts' example in this thread of string compares shows the problem, string comparison can be faster than a method call, yet still be responsible for most of your execution time). I don't have a solution for this. *Maybe* a VM will help with this but I'm not really sure of that.

I also have my suspicions about garbage collection in Ruby. I may be wrong to suspect GC, but you won't need a VM to do something to speed it up.

---

There are trade-offs all over the place here. And aside from using Mongrel, I don't think I've ever chosen a route (in Ruby) where native code was involved. And that includes databases -- I use a pure Ruby thing, xampl (see link below), and don't regret it.

Cheers,
Bob

----
Bob Hutchison -- blogs at <http://www.recursive.ca/hutch/>
Recursive Design Inc. -- <http://www.recursive.ca/>
Raconteur -- <http://www.raconteur.info/>
xampl for Ruby -- <http://rubyforge.org/projects/xampl/>

Peter Hickman wrote:

The problem is that Zed and Luis make out that performance is something that the whole Ruby community is deliberately ignoring. This is not the case, there are plenty of people who have no issue with the performance of Ruby. The truth is the performance is an issue for Zed and Luis and they are trying to make out that it is not their personal bugbear but some sort of conspiracy so they don't look like whiners. I have never though "damn Ruby's dismal performance, it should be able to do this faster" and I probably never will.

Yes we wouldn't say no to better performance but we (the Ruby community) are not being held back by the current level of performance.

Precisely. I'm not pretending there's no elephant in the room. My room
actually has no elephant in it. If yours does, well, my sympathies.

Hal

Lisp has a tiny syntax.
Lisp has uncountable years of development.
Lisp had lots of people who wanted it to go fast, so it goes fast.

...

Ruby has lots of people complaining about it being slow but only a
handful of people doing something about it.

Lisp does not have uncountable years of development. unless you're
speaking in terms of man-years, which would indeed be very difficult
to calculate, Lisp has 48 years of development (not counting
brainstorming or experimentation prior to its original specification
in 1958). I can count to 48 and I'm sure this ability is not unique to
me.

however, I think your point is actually a very good point. if the
things I've read have been true, compiled Lisp has performance
competitive with C and superior to Java. it started out slow and
became fast because people wanted it to do that. if people want Ruby
to do the same thing, the work is there for them to do.

I'm still skeptical about the whole question, though. if **other**
things I've read have also been true, you can get much better
performance improvements from putting your database in RAM than you
can from any language change. in fact, don't quote me on this, but my
recollection is that the difference was measured in orders of
magnitude.

···

--
Giles Bowkett
http://www.gilesgoatboy.org

Eric Hodel wrote:

Lisp has a tiny syntax.
Lisp has uncountable years of development.
Lisp had lots of people who wanted it to go fast, so it goes fast.

The Lisp compiler can optimize in ways that the ruby interpreter cannot.
(Optional type declarations, for example. Also, list manipulations are
not method calls.)

···

--
      vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407

A lot of people write a lot of software that don't run on desktop
machines. A lot of people write a lot of realtime or embedded
software. In those application domains, C++ works pretty well
(maybe the best?).

(although, I'm not sure why you'd use C++ for anything not embedded or
non-realtime. That's my experience, anyways.)

···

On 5/22/06, Alder Green <alder.green@gmail.com> wrote:

On 5/22/06, Madan Manoharan <madan.manoharan@gmail.com> wrote:
> On 5/22/06, benjohn@fysh.org <benjohn@fysh.org> wrote:
> ...
> Unfortunately, not all of us are in your boat. I really like Ruby, but
> if performance improvement is not going to be in Ruby's near future,
> my management is not going to buy into Ruby!
>
> In most of the corporate environments I have worked in, many managers
> tend to take IT decisions based on 'feelings'; 'speed' is a word that
> creates good 'feelings'. So, when the issue of performance is bought
> up, Ruby doesn't win (doesn't matter if the application requires it or
> not).
>
> IMO, if Ruby's vision is to penetrate the corporate environment, Ruby
> should address its performance issues among other things (e.g. support
> for apps -- Ruby on Rails).

This is exactly - but *exactly* - the sort of thing that was said
about Java at its onset. Especially in environments where it was
evaluated against a C++ backdrop. And guess what? Eventually, it
didn't matter! Java did get widely adopted because it was a better
language and offered an improved development experience.

In fact IIRC, Java was relatively much slower than Ruby when it
started gaining momentum. Certainly if you consider the computer speed
back then. How many project managers are saying "well, Java would give
us a much faster development process, and with the superior
maintainability we should not only beat everyone else to the market
but also keep ahead of the competition, but let's write the thing in
C++ to save those few extra CPU cycles"?. Now replace C++ with C,
Fortran or Assembly. How much software is written today in Assembly to
truly squeeze the last drops of performance out of the machine? ...
Exactly.

In fact, most of C++ (and I'd arge - any lanauge lower-level than
Ruby, including Java) use is *misuse*. Most developers using C++
today are doing it out of inertia, habit, or at most for legacy
reason. Even without the insanely powerful machines considered "norm"
on our desktop today, C++ development is 99% premature optimization.
And the funny fact is that most of those 99% won't even get the
performance they wasted 50%-90% of their development sweat (and
tears!) upon. Since contrary to popular myth, writing your application
in C++ won't make it magically faster. The developer would have to be
pretty smart for that. And for those 99%, being smart means they would
have been using Java. If they were even smarter, they'd be using Ruby
:stuck_out_tongue:

What I have proposed is ...
   * Concrete.
   * Simple to do.
   * Every Ruby user can pick an item on this list and contribute some
small
     but meaningful thing.
   * It doesn't push the problem onto some magical someone or something
else.
   * Much is reusable even if we do go to YARV or whatever.

I can't comment much on the technical details previously mentioned but there
is some room to comment here. I'm sure the proposal is well appreciated,
but would be better accepted if it came with a patch. The ruby core team
accepts patches, and I'm sure would be more than willing to accept patches
that pass tests and improve speed. So by all means, get the ball rolling,
be the first to contribute "some small meaningful thing", it certainly helps
gain momentum. And it certainly doesn't push the problem onto some magical
"every ruby user".

John Carter Phone : (64)(3) 358 6639

···

On 5/23/06, John Carter <john.carter@tait.co.nz> wrote:

Tait Electronics Fax : (64)(3) 359 4632
PO Box 1645 Christchurch Email : john.carter@tait.co.nz
New Zealand

Carter's Clarification of Murphy's Law.

"Things only ever go right so that they may go more spectacularly wrong
later."

From this principle, all of life and physics may be deduced.

--
===Tanner Burson===
tanner.burson@gmail.com
http://tannerburson.com <---Might even work one day...

I don't know of any Good one but here are some things I do...

  * Always benchmark first, profile and optimize later. Otherwise you don't
    know whether it was worth it. (Hint: Often the tweaks aren't worth it, or
    make things worse)

  * Look at the top most items in the profile list. Usually they are
    standard library functions. Silly things like or +...
    Ask your self, "What could be calling these thing so often?
    Can I make it do it less often? eg. Cache the result etc.)

  * Scan down the list for the first few user written methods. Usually the one
    that you spent the most time in has the most fat to trim.

  * Scan the list for the routine that took the longest (as opposed
    to the most time spent in it.) Try get that one to just do less.

  * Use strace, see what the system is doing at an OS level. I once
    improved another persons program (professional in production) by a
    factor of 40, yes FORTY times, by noting it was doing an lseek on every
    record read and changing that to an mmap.

  * Always look out for surprises. The best moment in an optimizers life is
    when you look at something and say "WTF! Why is _that_ routine taking so
    long!?"

  * Large number of calls to .size and .length and .count_objects methods are a
    clue some nidjit somewhere is doing something really N^2 stupid like...
     for( i=0; i < container.count_objects(); i++) {
     }

  * Use top, vmstat, times as well.
     Large usertime means optimize program.
     Large system time means you really hammering the system calls (that
     was a clue in the lseek case I mentioned above)
     Large real time small user and system means you are waiting for
     input from user / disk / network /...? Find out what.
     Watch the page in page out stats. Watch the swap in swap out stats.
     If you are paging or swapping, time to switch to memory consumption
     optimization!

   * Use my memprofile / newprofile tricks to try spot the
     http://wiki.rubygarden.org/Ruby/page/show/NewProfiler
     http://rubyforge.org/snippet/detail.php?type=snippet&id=70

John Carter Phone : (64)(3) 358 6639
Tait Electronics Fax : (64)(3) 359 4632
PO Box 1645 Christchurch Email : john.carter@tait.co.nz
New Zealand

Carter's Clarification of Murphy's Law.

"Things only ever go right so that they may go more spectacularly wrong later."

From this principle, all of life and physics may be deduced.

···

On Tue, 23 May 2006, Mark Somerville wrote:

Can anyone recommend some good or tutorials on profiling and benchmarking?
Although I have used them both (from the standard library), I feel I lack
fundamental knowledge about how to go about it.

Experiments done with the Linux kernel show -Os (optimize for size)
runs faster than -O3. The Os code is smaller and more of it can fit in
the CPU cache. The cost of cache misses out weighs the benefits of O3
optimizations.

···

On 5/30/06, John Carter <john.carter@tait.co.nz> wrote:

On Thu, 25 May 2006, Juergen Strobel wrote:

Certainly some of the optimizations can make the binaries larger, on a
desk top who cares?

--
Jon Smirl
jonsmirl@gmail.com

ThoML wrote:

put it into production in a server [...]
as long as you don't attempt to distribute the
resulting binaries. :slight_smile:

Your server or the server of a client?

Good question. :slight_smile: I am not an attorney. I'm guessing "your server" is OK, "a client's server" is not.

grocery_stocker:

The way I interpret open source licenses, if you take an open source
toolset, squeeze all the major bottlenecks out of it and put it into
production in a server, there's no requirement for you to release the
source of your hacks as long as you don't attempt to distribute the
resulting binaries. :slight_smile:

I could be wrong, but I believe that only
applies to the BSD license. Not the GNU one.

It applies both to BSD and GPL, but not to AGPL – which is basically GPL
plus the clause that the requirement of sharing the code also applies
when the code is distributed over a network, not just as a ‘binary’.

Or, to say it differently: in general, releasing a webapp under the
GPL is a bit pointless, and either BSD or AGPL should be used instead.
(The only case I can think of is the situation when you want a BSD-like
licence, but you incorporate some third-party code that’s GPL-licenced,
so you can’t BSD-licence it.)

-- Shot

···

On Jun 23, 7:24 am, "M. Edward (Ed) > Borasky" <zn...@cesmail.net> wrote:

--
I used to have a drinking problem. Now I love this stuff.

And yes, you're wrong there. It's about not (Shot's made the point about the
AGPL, but I havent taken a look at that) punishing others with your code ;).
If you decide to punish others with the results of your code (binaries), you
*have* to distribute (or make available some means of getting the code) your
code to them.

http://www.gnu.org/philosophy/free-sw.html: freedom 3 - "The freedom to
improve the program, and release your improvements to the public, so that
the whole community benefits (freedom 3). Access to the source code is a
precondition for this." Notice how it says "freedom"? Not "requirement"

-jf

···

On Mon, Jun 23, 2008 at 10:58 PM, grocery_stocker <cdalten@gmail.com> wrote:

On Jun 23, 7:24 am, "M. Edward (Ed) Borasky" <zn...@cesmail.net> > wrote:
>
> The way I interpret open source licenses, if you take an open source
> toolset, squeeze all the major bottlenecks out of it and put it into
> production in a server, there's no requirement for you to release the
> source of your hacks as long as you don't attempt to distribute the
> resulting binaries. :slight_smile:
>
> I've speculated a bit on what I think might happen in my blog.

I could be wrong, but I believe that only applies to the BSD license.
Not the GNU one.

--
In the meantime, here is your PSA:
"It's so hard to write a graphics driver that open-sourcing it would not
help."
-- Andrew Fear, Software Product Manager, NVIDIA Corporation

Makes sense. But.
I'd like to think about things like "reasonable slow" and "unreasonable
slow"; and Ruby sometimes is just __unreasonable__ slow. Here are some
examples:

* I'm working with custom UI library, which is based on HTML (namely, on
terrainformatica.com/htmlayout). There are a large amount of objects created
corresponding to DOM tree nodes ("large" means thousands) and profiler says,
that one of the slowest operation is Class#new - is it normal?

devil's advocate: yes it makes sense that 'new' is slow. it's generally slow
in all langs, including c++ (where stl insertion causes 3 of ctors and the
profiler will show this) and perl, which is claimed faster than ruby but, when
objects are used, crawls compared to ruby because object creation is so bad in
it. the fact that object creation is so slow is why people historically don't
represent chars as objects in text editors. that said, perhaps it can be sped
up - at least this is a good, concrete example!

* 5000 objects is loaded from database (by SELECT'ing and setting fields).
The major slower is that each object has Date field (Integer#gcd is very
slow). Or Kernel#send (I use it because of my DSL created) and so on.

probably this could be sped up too - but your point is taken.

Summarizing, after large profilings and optimizations, there are oftenly
some core methods (even Fixnum#+) show themselves as major speed problems.

This situation I call "unreasonable slow".

i like where you are going with this - let's see if a critical analysis of
some 'real' issues sheds light on whether they point to the need for a vm (my
feelings are that it will not, but i'd be happy to be proven wrong). i can't
think of a better way than to post some specific code and see what people can
do with it. history has shown that posting such challenges to the list yields
at least an order of magnitude speed-up, if it doesn't i'd say you are
correct - anyone have an example less than 100 lines or so we can play with?
without an example i'm afraid this discussion will be little more than hot
air. let's get something real to work with, prove that it is 'unreasonably'
slow, and then discuss.

kind regards.

-a

···

On Tue, 23 May 2006, Victor Shepelev wrote:
--
be kind whenever possible... it is always possible.
- h.h. the 14th dali lama

... you make good points - but let me just throw in my 2 cts:

virtual machines are stupid. java is slow. c++ is slow. python is slow.
ruby is slow. so what. if you want fast you need c or fortan or assembler.

Ara, do you not see value in a Ruby VM, or is just that speed is not, in
itself, a justification for a VM?

i'm saying that gcc kills any vm both on speed and portability, including
windows, and has decades of hard work put in.

(The speed-related advantage to a VM is that it does not require one to know C, etc., or have a compiler for all target platforms. Maybe not as fast as tight compiled C, but also not as much trouble. It's a trade.)

hmmm. i think sun's experience with the java vm shows otherwise - remember
when you couldn't even 'stop' threads! i think making a fast, protable, vm is
a lions job. however, i'd be quite happy to be wrong, it just seems
un-likely. consider how long has parrot been 'almost', for example...

-a

···

On Tue, 23 May 2006, James Britt wrote:

ara.t.howard@noaa.gov wrote:

--
be kind whenever possible... it is always possible.
- h.h. the 14th dali lama

>
> The thing that always stands out to me in these performance discussions is
> that people argue that Ruby needs a performance improvement, but there are
> rarely any specifics attached to that analysis.
>
> How much of speed improvement? How fast should Ruby be? For what?
>

Please don't get me wrong, I really like Ruby. However, just because
*I* like Ruby doesn't mean that I can start using it to develop
applications within our corporation (I work for a large corporation).
When I brought up using Ruby for application development with my
senior IT manager, he was concerned about:

(1) Performance: Here, the question is NOT about 'how fast should Ruby
be', but is about what people who have the capacity to make
'significant' corporate decisions are 'being told' about Ruby's
performance by consultants. I have seen presentations by
'well-established' consulting companies that show Ruby's performance
to be an order of magnitude slower than Java for web apps. I don't
have time to develop benchmark tests comparing the two languages, but
have to depend on Ruby app. developers to produce those benchmarks;
unfortunately I cannot find them easily. Now, Zed (I would consider
him an authority on Ruby) comes out and talks about performance issues
with Ruby (and YARV will solve it in the future). How am I now to
convince my manager that Ruby is 'better' (within the context of
performance)?

Read what Zed said about Rails app performance though. Even though
Ruby can be slow, he said that with its built in caching, Rails apps are often
faster than Java Web apps.

The reason why IT managers want 'performance' even if the application
*really* doesn't require it, is to cover their behinds, among other
thing. For example, if the website is slow, they don't want it to be
attributed to the language, even if that is not the case (could be a
network problem, but the network group would more willingly point
their fingers at the app. development group for their choice of
language than to accept their problem); has happened before and will
happen again.

sorry, but if you don't have the logging/instrumentation to show where the
slowdown is, it doesn't matter what language you've written in. Using
a languages because its marketing is better in order to "protect" yourself
is a good way to end up in bigger trouble down the line. Profile, Optimize,
Log. Hard, verifiable numbers will win everytime -- if they don't you've got
another problem.

So, here 'performance' is not for the sake of performance demanded by
the application, but for the sake of 'not wanting to be talked to by
the boss'. That is the reason I said that many IT managers make
'performance' decisions based on 'feelings', not necessarily had data.

see above.

(2) Using two different languages for different performance needs:
Some fellow Rubyists have said that they would switch to C if their
app. needed performance boosts. This will work if it is a personal or
small project. But when in an large corporation, switching between
languages to get performance gains will result in maintenance
nightmares. Many IT managers understand this and have experienced
this. Combined that with the mantra 'Java is fast' preached by many
consultants, and the decision for the senior IT manager becomes easy:
one language that can be used for apps that require *real* performance
and for ones that don't: Java.

you don't need to switch out the whole language. Ruby uses C extensions
quite readily and they're not too hard to write (RubyInline makes it even
easier.) You still get something that looks and feels like Ruby from the
high level view, only the bottleneck(s) have been replaced.

The remainder of this email is off topic to the general performance thread,
but I find it to be wrong-headed as well. If need be, maybe we should start
another email thread to discuss Ruby and it's commercial support or lack
thereof.

···

On 5/22/06, Madan Manoharan <madan.manoharan@gmail.com> wrote:

On 5/22/06, Kirk Haines <khaines@enigo.com> wrote:

(3) Survival of Language: This is another bigee. If the IT manager OKs
a language that happens to be a fad, then he might as well bid goodbye
to his job (lost productivity, cost, etc). So, they want to be sure
that the language is going to be in the 'main stream' for a long time.
In their mind, the only way they can be assured of that is:
       (a) if a large corporation is going to support it -- not
necessarily the language, but any application build using the
language. The thinking goes that if a large corporation is going to
put its weight behind the language, then that corporation will not let
the language die. This is what I meant when I said 'lack of corporate
support for Ruby on Rails'; I don't mean to belittle the corporations
that are offering support for Ruby on Rails, but I am talking from a
large corporation's point of view. A good case study would be on how
Linux got its foot hold into the corporate world.

Once again, if Ruby's vision is *not* to penetrate the corporate
environment as Ryan pointed out (but would be a nice validation if it
indeed penetrate the corporate world by *some* means), then this
discussion is moot. Knowing that, I wouldn't try to push Ruby to my
managers; I will use it for personal projects.

On the other hand, if Ruby has a dream of penetrating the corporate
world, then it needs a marketing machine that would deal with the real
and, more importantly, the 'illusionary' problems created in the
corporate world -- just like Firefox's or Linux's marketing machine.
Unfortunately, penetrating the corporate world by *some* means is
never going to happen, unless an concerted effort is made.

Just some thoughts from a guy who has been in the IT hot seat before,
and is glad he is no longer there!

Sorry for this long post.

-Madan.

--
thanks,
-pate
-------------------------

Madan Manoharan wrote:

.. Once again, if Ruby's vision is *not* to penetrate the corporate
environment as Ryan pointed out (but would be a nice validation if it
indeed penetrate the corporate world by *some* means), then this
discussion is moot. Knowing that, I wouldn't try to push Ruby to my
managers; I will use it for personal projects.

On the other hand, if Ruby has a dream of penetrating the corporate
world, then it needs a marketing machine that would deal with the real
and, more importantly, the 'illusionary' problems created in the
corporate world -- just like Firefox's or Linux's marketing machine.
Unfortunately, penetrating the corporate world by *some* means is
never going to happen, unless an concerted effort is made.

Ruby doesn't have a vision or a dream; Rubyists have dreams and visions.

Ruby is what you make it.

···

--
James Britt

"You harmonize; then you customize."
  - Wilson Pickett