Ruby vs. PHP

I’m jumping in late here, and I’ve only skimmed most of the replies,
so pardon me if I’m repeating anything already said:

On 10/1/07, Marcin R. [email protected] wrote:

Why is this a good idea?

why not?
rails is easy to prototype but is painfully slow and hard to optimize, i
know caching is going to play huge role but optimized complex sql
queries are also important

On the other hand, there are lots of folks working on optimizing
Rails, how many are working on optimizing your custom tailored
framework.

If you don’t want to use Rails, then why not look at something which
already has somewhat of a community like merb?

possibility of continous development is one of strong points of rails,
and that’s why i’m advertising it, code writen by that large group of
php developers is usually unmaintainable. I had plenty of expirience
with php and i know how strangely can be php written, and rails forces
good practices like MVC, and ruby i much cleaner langue then php to
begin wth

Here I totally agree with you. In fact, I’d argue that Rails is a
better choice for a “seasonally” developed project than the average
PHP application.

Nicely written PHP code can be picked up quickly by a new developer,
but from what I’ve seen except for some large open-source php efforts
like mediawiki, there’s a lot of not so nice PHP code out there. I’ve
tried a couple of times to take on maintenance of PHP apps and have
always had to turn down the gig.

On the other hand, Rails apps tend to be easy to pick up even “second
hand.” Most follow the convention over configuration philosophy, so
they all tend to have similar structure. And the good ones tend to
have nice test suites which make it easier for the new guy to grok
what it’s supposed to do.

So even though the population of Rails savvy programmers might be
smaller than the PHP community, there’s a much higher probability that
any of then could pick up and existing Rails app than a random PHP
programmer could understand a random PHP application.

On the other hand, how many will understand your custom MVC framework?

Of course if you’re looking for job security AFTER you get the gig…


Rick DeNatale

My blog on Ruby
http://talklikeaduck.denhaven2.com/

On Tue, Oct 02, 2007 at 09:54:29PM +0900, Richard C. wrote:

Rails in some respects, but saying PHP beats Rails is like saying wood as
a boat-building material beats a given shipyard (which happens to make
all its ships out of steel).

Read my response again - the high availability of PHP developers suits
certain classes of customer whose web development is not continuous.
This will change of course (probably in the next year). For this purpose,
Rails and PHP are equivalent - tools for building dynamics web sites.

You’re talking about which is more socially acceptable to a manager,
then, rather than which is the better tool for the job – because that’s
the only way in which the two are equivalent, as far as I can tell.
In
any other sense, saying the two are equivalent in that they’re tools for
building dynamic web sites would be like saying that a hammer and a
prefab house component factory are equivalent because they’re tools for
constructing homes.

Java isn’t what I’d call a “systems language”.

A lot of people are. Especially on a web environment - its the language
that can do the heavy lifting (long-lived, CPU bound processes) on the
server.

I know that some people call Java a “systems language”, but in the (age
old) sense in which I’m familiar with the term “systems language”, it
isn’t.

but AFAIK, production code still has to be written in the big 4.

Amazon however are using increasing amounts of Ruby and dynamic languages
in production code. However Amazon is in a rather unique situation wrt to
code maintenance (Steve Yegge blogged on that one too, a while back).

Amazon’s hiring seems to focus more on Perl than any other single
language, actually – and has for a long time. As such, while the
amount
of dynamic language usage may actually be increasing, I think one might
better represent the situation by saying that Amazon has used dynamic
languages to a significant degree for a long time.

That’s “long time” in Intarweb years, of course.

Chad P. wrote:

and shut case. I also don’t see how building a Ruby web framework from
easier (even though shared hosting probably isn’t what’s intended

But be nice to your customers.

. . . even if it means using what’s best, rather than what’s most
popular.

Thank God someone that understands :slight_smile: that are reasons why i want to use
ruby and mix of rails/custom framework, let’s face it, php programmers
are usually not programmers at all.

Rails is great but heavy and slow.

I want to use best instead of most popular, and i asked you what’s best
in ruby, and all i heard until this post was why php is more popular,
and CTO should have all the answers anyway. geez :slight_smile:

Rick DeNatale wrote:

that Ruby (i don’t mean rails) with custom tailored MVC framework is
Rails, how many are working on optimizing your custom tailored
framework.

If you don’t want to use Rails, then why not look at something which
already has somewhat of a community like merb?

well, I’m still considering merb, in fact my custom framework borrowed
lot’s from merb, but basic benchmarks on mostly used (by me at least)
features showed that my custom framework was 20 times faster then rails,
and 2-3 times faster then merb :]

i just wrote what i needed, not what i thought someone will need

So even though the population of Rails savvy programmers might be
smaller than the PHP community, there’s a much higher probability that
any of then could pick up and existing Rails app than a random PHP
programmer could understand a random PHP application.
I had expirience with PHP “programmers” and let me just say they waren’t
programmers, I remember one writing loop with use of two wariables, one
to count iterations and one to be set to true if iterations reach
certain level.

also due to fact that php is usually view centric, there is loots of
doubled code, no clear directory structure, sql queries inside views,
configuration scattered between 10-20 files, and some other juicy stuff
:slight_smile:

On the other hand, how many will understand your custom MVC
framework?
anyone who knows how Ruby works and know MVC pattern?
I’m using Haml for views, Sequel or postgres for DB, directory layout is
really similar to rails, what’s the problem ?

Of course if you’re looking for job security AFTER you get the
gig…
Currently, i have to put down job offers, I don’t really need job
security, but i enjoy working with people i work with right now, and
fact that they let me do cool and new stuff, that’s why i want to do it
for few more months :slight_smile: instead of going back to PHP or C++ programming
:]

On Wed, Oct 03, 2007 at 12:57:07AM +0900, Richard C. wrote:

The reasoning behind building another Ruby Web Framework from
scratch on the customers’ dollars instead of using the already
excellent ones out there seemed a bit flawed to me. In which, case
a Warts-n-all PHP solution may have suited the customer better
(who according to the OP is not tech-savvy).

(Chad - this was the point I was getting at when I was saying
PHP beats Rails)

I don’t think saying that PHP serves the customer better is such an open
and shut case. I also don’t see how building a Ruby web framework from
scratch wastes customer dollars any more than building a PHP web
framework from scratch.

Based on what I’ve seen here, most of the arguments against doing what
the OP proposes are based on:

  1. PHP is more popular, so getting more (on average, low quality)
    programmers familiar with the technology is easier.

  2. PHP is more popular, so migrating from one shared host to another
    is
    easier (even though shared hosting probably isn’t what’s intended
    here).

  3. PHP is more popular, so managers are less likely to balk at it.

  4. Rails already exists, so it’s better to build a new framework than
    to build a new framework. (One of those two is in PHP, the other in
    Ruby.)

I’m just not buying any of that as technical reasons to choose PHP
instead of non-Rails R…

stake holders.
. . . which is a great reason to use LAMP if that’s the only way you’re
going to get the contract. It’s not such a great reason if you’re
looking for the best technologies to use for a given project.

So I think a home-grown non-Rails R. solution is a non-starter here
for a number of reasons. It’s not “Ruby vs. PHP”, it’s “Rails vs. PHP”.

And no disservice to the non-Rails R. frameworks out there. Certainly
pure-Mongrel handlers, Merb & thread-safe ORM sounds like a fun
implementation to me.

But be nice to your customers.

. . . even if it means using what’s best, rather than what’s most
popular.

Chad P. wrote:

Amazon’s hiring seems to focus more on Perl than any other single
language, actually – and has for a long time. As such, while the amount
of dynamic language usage may actually be increasing, I think one might
better represent the situation by saying that Amazon has used dynamic
languages to a significant degree for a long time.

That’s “long time” in Intarweb years, of course.

Two tidbits about Amazon:

  1. I don’t remember how I stumbled across it, but somewhere in the great
    electronic beyond there is a blog posting by someone who describes the
    hiring process at Amazon. One of the things they look for is someone who
    can bang out a quick solution to massive text crunching problems using
    regular expressions, either in Perl or more primitive command line
    tools. I don’t recall whether Python or Ruby were “acceptable”.

  2. A year or so ago there was an ACM conference on functional languages
    here in Portland. I didn’t go to the conference itself, but I did attend
    a Saturday Erlang workshop and a Sunday Scheme workshop. At the Erlang
    workshop, the small (30 or so) room at Portland State University was
    packed to overflowing – at least 60 jammed into it – and at least a
    dozen of them were from a couple of teams at Amazon, who were hiring.

On Wed, 3 Oct 2007 11:22:40 +0900, M. Edward (Ed) Borasky wrote:

  1. I don’t remember how I stumbled across it, but somewhere in the great
    electronic beyond there is a blog posting by someone who describes the
    hiring process at Amazon. One of the things they look for is someone who
    can bang out a quick solution to massive text crunching problems using
    regular expressions, either in Perl or more primitive command line
    tools. I don’t recall whether Python or Ruby were “acceptable”.

I think that was Steve Yegge’s blog post - he used to work for Amazon,
now
works for Google:

On Wed, Oct 03, 2007 at 11:22:40AM +0900, M. Edward (Ed) Borasky wrote:

  1. A year or so ago there was an ACM conference on functional languages
    here in Portland. I didn’t go to the conference itself, but I did attend
    a Saturday Erlang workshop and a Sunday Scheme workshop. At the Erlang
    workshop, the small (30 or so) room at Portland State University was
    packed to overflowing – at least 60 jammed into it – and at least a
    dozen of them were from a couple of teams at Amazon, who were hiring.

Missed opportunities . . .

Actually, I like my non-corporate work lifestyle. If I was looking for
a
corporate coder job, though, that’d be the sort of thing that might be
high on my list – getting picked up by a team attending an Erlang
workshop. I’d be even more impressed if that happened at the Scheme
workshop.

On 2-okt-2007, at 22:02, Chad P. wrote:

I’d say that PHP should have taken a hint from environment
variables if
it wanted to use those sigils more effectively – by not using them
except in certain cases where they are being interpolated. They’re
just
line noise most of the time in PHP.

To my understanding, ruby-talk is too noble a place to discuss the
syntax merits of PHP.

On Thu, 4 Oct 2007, Julian T. wrote:

To my understanding, ruby-talk is too noble a place to discuss the syntax
merits of PHP.

or the Java clone it’s becoming.

Chad P. wrote:

Actually, I like my non-corporate work lifestyle. If I was looking for a
corporate coder job, though, that’d be the sort of thing that might be
high on my list – getting picked up by a team attending an Erlang
workshop. I’d be even more impressed if that happened at the Scheme
workshop.

Well … I must say I enjoyed the Scheme workshop, but, yes, Scheme is
probably always going to be a lab rat rather than a workhorse. :slight_smile: There
were one or two papers from people with “industrial-strength”
applications written in Scheme, though.

I’m so happy I get paid to program in R – it’s really one of the better
languages out there, although if you don’t do number crunching or
statistics, there isn’t much motivation to learn it. It’s a nice
functional language, lexically scoped, and is well suited to processing
arrays of data with small amounts of code. It’s what Lisp should have
been. Or rather, S is what Lisp should have been and R is a lexically
scoped dialect of S. :slight_smile:

“M. Edward (Ed) Borasky” [email protected] wrote in message
news:[email protected]

  1. I don’t remember how I stumbled across it, but somewhere in the great
    electronic beyond there is a blog posting by someone who describes the
    hiring process at Amazon. One of the things they look for is someone who
    can bang out a quick solution to massive text crunching problems using
    regular expressions, either in Perl or more primitive command line tools.
    I don’t recall whether Python or Ruby were “acceptable”.

Sorry for OT, but I did not start it :). The intervew question for quick
text crunching came from the same SteveY. His huge productivity in
writing
blogs has a significant impact on any company he works for :).
What you use at the interview - perl, python, ruby or [put here whatever
you
want] - does not make any difference, as long as you use it right (and
have
in your backpack at least one of more conventional OO languages too) :slight_smile:

– EK

On Oct 1, 7:26 am, Marcin R. [email protected] wrote:

Robert

i found this one, and also it’s interprete ruby not YARV or JRbuy

Yes it does!

Core Ruby 1.9.0 and JRuby 1.0

http://shootout.alioth.debian.org/gp4sandbox/index.php

Robert D. wrote:

I guess that depends on how you define “value” and “majority”. As a
practicing performance engineer, here’s my view on the subject:

  1. The site is very clear about what it is doing, how it is doing it,
    why it is doing it and to a great extent how one can (not) and should
    (not) interpret the results. However, anyone is free to misinterpret any
    of that out of either ignorance or competitive marketing zeal.

  2. If you actually look at the benchmark timings for the three main Ruby
    implementations tested, jRuby, Ruby 1.8.6 and Ruby 1.9.x, you’ll find
    that they give roughly the same comparative speeds on these benchmarks
    as they do on the virtual machine benchmarks bundled into the Ruby 1.9.x
    code. In fact, I think some of them are in both sets. This is a good
    sign.

  3. Given 2, one can be (and I am) encouraged to go farther and use the
    site to compare implementations of other languages with implementations
    of Ruby. I have not done a recent comprehensive analysis, but if the raw
    data can be downloaded in a form suitable for it, I’ll take a stab at
    it.

  4. I suspect the main problem the “majority of the community” has with
    the site is that it shows that the current (MRI) Ruby 1.8.6
    implementation is slower than other languages commonly used to implement
    web applications. And that is mostly competitive marketing zeal. Of
    course the Ruby community wants Ruby to be faster than Perl, Python, PHP
    or Java. And when it turns out that it isn’t faster, there are two
    things that can be done:

(a) Argue about how much more productive Ruby is, saying that you can
throw hardware at the scaling problem with the dollars you save
on programmers, and/or

(b) Make faster implementations of Ruby.

Neither of these options is “right” or “wrong” IMHO. For (a), I claim
that the economics of programmer productivity and the economics of web
application deployment and scaling are in fact two very different
studies. You can get degrees in either and earn a comfortable living
doing either. I’ve spent more time on the second because I think it’s
more fun. :slight_smile:

For (b), I think the results of Ruby 1.9.x (KRI) and jRuby speak for
themselves, and at some point in the not-too-distant future we should
have some IronRuby and Rubinius numbers as well. And perhaps the Parrot
effort will change the playing field for Perl, Python, PHP and Ruby in
one bold beak-stroke! :slight_smile:

And perhaps the Parrot
effort will change the playing field for Perl, Python, PHP and
Ruby in one bold beak-stroke! :slight_smile:

I can hear the ice crunching and breaking under your feet
already :stuck_out_tongue_winking_eye:

On Sun, Oct 07, 2007 at 12:38:21AM +0900, M. Edward (Ed) Borasky wrote:

  1. The site is very clear about what it is doing, how it is doing it,
    why it is doing it and to a great extent how one can (not) and should
    (not) interpret the results. However, anyone is free to misinterpret any
    of that out of either ignorance or competitive marketing zeal.

I agree. The site is useful – just not in the immediately obvious way.
For that purpose, it’s not useful (where “useful” includes “good at
providing strong technical evidence”). That’s because the “immediately
obvious way” is in comparing languages to decide what should be used for
performance purposes between languages that are very close on the
execution performance scale, and micro-benchmarks are notoriously bad at
that, for a number of reasons.

  1. I suspect the main problem the “majority of the community” has with
    the site is that it shows that the current (MRI) Ruby 1.8.6
    implementation is slower than other languages commonly used to implement
    web applications. And that is mostly competitive marketing zeal. Of
    course the Ruby community wants Ruby to be faster than Perl, Python, PHP
    or Java. And when it turns out that it isn’t faster, there are two
    things that can be done:

I don’t think that’s entirely the case (or even close-to-entirely). I
don’t just participate in the Ruby community – I’m as much an on-again,
off-again member of a couple other language communities as I am of the
Ruby community here at ruby-talk (if not more so). One in particular is
the Perl community, and just to make a point I’ll compare the two on
this
subject.

When people in each community look at comparative benchmarks for Ruby
and
Perl, and when they see that Perl fairly consistently kicks the crap out
of Ruby for execution speed, I see that in both communities they tend
to follow that up with something like “. . . but micro-benchmarks are
pretty much useless. Only real-world performance testing matters, and
usually even that is just a case of premature optimization.” In other
words, considering that even the usual “winner” in such a “contest”
dismisses those benchmarks as mostly useless in that respect, I don’t
think the problem people in the “losing” camp have with the way people
tend to want to use benchmarks is primarily one of wanting to ignore
what
shines unfavorable light in their direction.

I see the same things being said by Perlists and Rubyists: that
programmer productivity, flexibility, “real-world” performance,
maintainability, and other factors are more important. In either camp,
people then tend to provide evidence that their chosen language is the
best for these factors in some way – at least for the purposes of the
person talking. As someone who likes and uses both Perl and Ruby, I
find
that both “sides” are right, too. They’re just right for differet use
cases.

Chad P. wrote:

performance purposes between languages that are very close on the
execution performance scale, and micro-benchmarks are notoriously bad at
that, for a number of reasons.

Well …

  1. The site compares programming languages using micro-benchmarks, or,
    more accurately, “benchmarks small enough to be easily implemented using
    a variety of languages and covering a variety of commonly-used data
    types and algorithms.”

  2. I’ve asked the Shootout team for a spreadsheet of all the timings for
    all the languages, and if I get it, I’ll post an analysis here (relative
    to MRI) and on the Shootout forum (relative to gcc).

  3. I define “useful” the same way the Shootout defines it – a way of
    comparing languages on a common set of benchmarks. If you have a problem
    with the Shootout, take it up with the Shootout, not with me.

off-again member of a couple other language communities as I am of the
words, considering that even the usual “winner” in such a “contest”
dismisses those benchmarks as mostly useless in that respect, I don’t
think the problem people in the “losing” camp have with the way people
tend to want to use benchmarks is primarily one of wanting to ignore what
shines unfavorable light in their direction.

That’s an easy way to dismiss the results, but you’re assuming

  1. That micro-benchmarks are pretty much useless. I don’t agree.
    Processors, compilers, interpreters, virtual machines and languages can
    only be measured and optimized using micro-benchmarks.

Consider Intel (or AMD, if you prefer). Could they measure every
real-world application, ranging from reading email to web servers to
scientific matrix algorithms to video editing to multi-player shootouts
to text indexing to … with every commonly-used compiler and
interpreter? Of course not!

You have to reduce the benchmark set to something reasonable and make
some simplifying assumptions. And in the end, you have to have some
statistical way of saying that a chip design is “good enough”, not
that it is perfect. I don’t call that “premature optimization”, I call
it PhD-level electrical engineering!

  1. That competition doesn’t matter. Again, I don’t agree. If it doesn’t
    matter, why do we do it? We long ago stopped racing horses because it
    “improved the breed” and continue to race horses only because it is a
    source of entertainment, and of tax revenue in some jurisdictions. But
    we race computer chips and languages and algorithms because it does
    improve the breed.

Maybe in the 60 or so years since computer racing started, we’re
starting to reach the point where it isn’t improving the breed any more
and is only a source of entertainment. But we still don’t have a
definitive answer to whether P = NP, we have “grand challenge” problems
that call for peta-scale computing platforms and languages to make such
problems easily solved, there appears to be a limitless market for
devices that put the entire historical collection of recorded music in
one’s pocket, and so on.

To sum up, as a practicing performance engineer, I can say that there
are ways to go from micro-benchmark results to “good enough but not
perfect” predictions of real-world performance. That’s why we do it and
why it matters in a nutshell.

I see the same things being said by Perlists and Rubyists: that
programmer productivity, flexibility, “real-world” performance,
maintainability, and other factors are more important. In either camp,
people then tend to provide evidence that their chosen language is the
best for these factors in some way – at least for the purposes of the
person talking. As someone who likes and uses both Perl and Ruby, I find
that both “sides” are right, too. They’re just right for differet use
cases.

Well … in the specific case of Perl vs. Ruby, I’m not by any means an
expert on the use cases that differentiate between the two. Ruby is by
design a successor to Perl, IIRC. So I would expect Ruby to provide a
better “user experience” than Perl for a lot of use cases.

But I don’t see how it’s possible that language/implementation A can be
significantly faster than language/implementation B on a varied set of
micro-benchmarks and yet language/implementation B can be significantly
faster than language/implementation A on more than, say, one,
real-world application. Computers and mathematics just don’t work that
way.

On Sun, Oct 07, 2007 at 03:02:15AM +0900, M. Edward (Ed) Borasky wrote:

Perl, and when they see that Perl fairly consistently kicks the crap out
That’s an easy way to dismiss the results, but you’re assuming

  1. That micro-benchmarks are pretty much useless. I don’t agree.
    Processors, compilers, interpreters, virtual machines and languages can
    only be measured and optimized using micro-benchmarks.

No, I’m not assuming that. I’m pointing out that objections to using
those micro-benchmarks to choose a language to use for general purpose
programming are common, and that I find them agreeable.
Micro-benchmarks
are very useful for determining problem areas in execution
performance,
if you happen to be on the core implementation maitenance team, but
that’s not what I was talking about when I said that as an overall
performance measure for purposes of choosing a language they aren’t so
useful.

In other words, the problem is that you’re assuming that I’m assuming
something that I am not, in fact, assuming. Put otherwise, I basically
said that for the purpose to which most people seem tempted to put those
micro-benchmarks when they drag them out while trolling, they’re useless
in any practical sense – and you generalized from there to assume that
I
was saying they’re never useful for anything.

  1. That competition doesn’t matter. Again, I don’t agree. If it doesn’t
    matter, why do we do it? We long ago stopped racing horses because it
    “improved the breed” and continue to race horses only because it is a
    source of entertainment, and of tax revenue in some jurisdictions. But
    we race computer chips and languages and algorithms because it does
    improve the breed.

Again, you’re putting words in my mouth. I didn’t say competition
doesn’t matter. What I suggested is that “my interpreter is faster than
yours” competition based on micro-benchmarks is pointless for languages
in the same general neighborhood of execution performance, and that
usually other concerns are far more important within a given
neighborhood of performance than execution speed. If you want faster
execution speed, you should be in a completely different performance
neighborhood, not quibbling over whether Ruby or Python is faster for an
arbitrary set of micro-benchmarks, in other words.

To sum up, as a practicing performance engineer, I can say that there
are ways to go from micro-benchmark results to “good enough but not
perfect” predictions of real-world performance. That’s why we do it and
why it matters in a nutshell.

Yes, we can – but the margin for error is so great that, again, petty
microsecond disputes between Perl, Python, and Ruby are just that:
petty.
I say this despite the fact that, overall, Perl kicks the tuckus of both
these other close competitors – and Perl is one of my favorite
languages. I would have said roughly the same thing even before I
started using Ruby.

Well … in the specific case of Perl vs. Ruby, I’m not by any means an
expert on the use cases that differentiate between the two. Ruby is by
design a successor to Perl, IIRC. So I would expect Ruby to provide a
better “user experience” than Perl for a lot of use cases.

I don’t know if it was intended that way, but I certainly don’t view it
that way. They are sufficiently different that they are simply
different languages, not successive languages, in practice.
Granted,
I’d definitely be willing to use Ruby as Perl’s successor within the
specific niche of “object oriented programming”, since Perl’s OO syntax
is so onerous to deal with (by comparison), but OOP is not the be-all
and
end-all of programming (the last fifteen years of Java industry
domination notwithstanding).

But I don’t see how it’s possible that language/implementation A can be
significantly faster than language/implementation B on a varied set of
micro-benchmarks and yet language/implementation B can be significantly
faster than language/implementation A on more than, say, one,
real-world application. Computers and mathematics just don’t work that way.

Who said anything about “significantly faster”? I’m just talking about
the fact that Perl consistently kicking Ruby’s tail in performance
benchmarks doesn’t mean a whole lot when choosing languages for
projects,
generally speaking, since if performance is enough of a concern to
override the other factors involved you should be using something like
C,
Objective Caml, or at least compiled Lisp instead. In other words, if
you’re trying to decide between Perl and Ruby based on performance
micro-benchmarks, you might as well be choosing between two paint shops
for your car’s new coat of paint based on which one has a better record
for using paint that provides a finish with a lower drag coefficient.
Obviously, it’s such a miniscule difference in the grand scheme of
things
that you’re better of deciding based on whether you like the color,
whether a given shop’s paint jobs tend to last longer, how much it’ll
cost you at one shop vs. the other, and so on.

Chad P. wrote:

No, I’m not assuming that. I’m pointing out that objections to using
those micro-benchmarks to choose a language to use for general purpose
programming are common, and that I find them agreeable. Micro-benchmarks
are very useful for determining problem areas in execution performance,
if you happen to be on the core implementation maitenance team, but
that’s not what I was talking about when I said that as an overall
performance measure for purposes of choosing a language they aren’t so
useful.

Well … OK … you agree with me that they are useful for core
implementation. And I still think they’re useful when comparing
performance of languages for general purpose programming, provided the
benchmark suite is comprehensive and the statistical comparison
methodology is correct.

I further think that the Alioth Shootout Suite is comprehensive enough
to distinguish between the performance of those languages for which
most of the benchmarks actually ran. The trick is the statistical
methodology you use.

Ideally, of course, you’d have a benchmark suite that matches the
application set. That’s where people get into trouble with benchmark
suites – they assume that a given suite, for example, the SPEC integer
suite, is representative of their application.

Now I could look at the benchmarks themselves and throw out those that
were obviously orthogonal to web servers when comparing languages for
implementing web servers. But I don’t think I need to go that far –
it’s easier to just throw out the statistical outliers and come up with
a set of numbers that’s a general characterization of the relative
performance of the languages. That’s why I asked for the raw data (which
I received, by the way).

What I suggested is that “my interpreter is faster than
yours” competition based on micro-benchmarks is pointless for languages
in the same general neighborhood of execution performance, and that
usually other concerns are far more important within a given
neighborhood of performance than execution speed. If you want faster
execution speed, you should be in a completely different performance
neighborhood, not quibbling over whether Ruby or Python is faster for an
arbitrary set of micro-benchmarks, in other words.

Of course. I’m still in the process of crunching the numbers, but what
I’ve seen so far is that MRI Ruby is not in the general neighborhood
of Perl, Python or PHP, but YARV is in that neighborhood. I do need to
tighten up the calculations slightly and get rid of some bogus points,
but I’m not expecting a major change in that.

As for things in the “fast lane”, I started with gcc, and there are only
a few things faster than gcc. The one that jumped out and bit me on the
nose was a functional language called “clean”. I’m just about to
download it and see what makes it tick (or to stretch the analogy, how
tightly it’s wound). And the slow lane has such snails as “groovy” and
“rebol” lumbering away.

Yes, we can – but the margin for error is so great that, again, petty
microsecond disputes between Perl, Python, and Ruby are just that: petty.
I say this despite the fact that, overall, Perl kicks the tuckus of both
these other close competitors – and Perl is one of my favorite
languages. I would have said roughly the same thing even before I
started using Ruby.

Well … let me finish with the numbers, but I think you’ll be surprised
at how close Perl and Python are to each other and how far away MRI is
from the two of them. It’s not a “petty microsecond dispute” for MRI.

Who said anything about “significantly faster”? I’m just talking about
the fact that Perl consistently kicking Ruby’s tail in performance
benchmarks doesn’t mean a whole lot when choosing languages for projects,
generally speaking, since if performance is enough of a concern to
override the other factors involved you should be using something like C,
Objective Caml, or at least compiled Lisp instead.

Of course. But if the choice is between “dynamic languages with a
sufficient supply of competent developers available”, for example, Perl,
Python, PHP and Ruby, and the assumption is that they are equally
productive – you’re just trying to assess how much hardware you’re
going to have to throw at it if your customer growth takes off – you’re
going to want the fastest one. Or, more to the point, you’re probably
going to dismiss the slowest one and move on to the other decision
factors.

On Sun, Oct 07, 2007 at 07:50:50AM +0900, M. Edward (Ed) Borasky wrote:

Well … OK … you agree with me that they are useful for core
implementation. And I still think they’re useful when comparing
performance of languages for general purpose programming, provided the
benchmark suite is comprehensive and the statistical comparison
methodology is correct.

I still think you’re missing my main point – which is that, in general,
comparing languages within a few points of standard deviation (that is
to
say not necessarily within standard deviation, but at least close) is
almost fruitless for most purposes. The reason I think it’s pretty much
irrelevant to good decision-making is that other factors will far
outweigh the miniscule performance benefits you might achieve by
examining benchmarks you hope will be representative of your application
design needs – factors like syntactic construct support for the
architecture you’ll implement, general readability, metaprogramming
capabilities, library support, an agreeable inheritance model,
availability in your deployment environment, et cetera.

Would you rather implement a complex object oriented application
architecture in Ruby or Perl, knowing Perl’s obtuse OOP syntax and with
a
benchmark-suggested 1.1% performance improvement for Perl, all else
being
equal? I’d look at the 1.1% performance improvement and say “So f-ing
what? It’s OOP. Use Ruby.”

On the other hand, if we were comparing Ruby and OCaml, I’d have to
reconsider if performance is a concern, because the performance
improvement would be more like an order of magnitude rather than a
percentage point or two.

Of course. I’m still in the process of crunching the numbers, but what
I’ve seen so far is that MRI Ruby is not in the general neighborhood
of Perl, Python or PHP, but YARV is in that neighborhood. I do need to
tighten up the calculations slightly and get rid of some bogus points,
but I’m not expecting a major change in that.

I’ll have a look at the document you provided in your next email (which
I’ve only skimmed very briefly so far) to see what you consider a
“neighborhood”, then.

As for things in the “fast lane”, I started with gcc, and there are only
a few things faster than gcc. The one that jumped out and bit me on the
nose was a functional language called “clean”. I’m just about to
download it and see what makes it tick (or to stretch the analogy, how
tightly it’s wound). And the slow lane has such snails as “groovy” and
“rebol” lumbering away.

I’ve heard incredibly good things about Clean. I’ve also witnessed
something like a meltdown on a mailing list because someone reached a
frustration saturation point dealing with the language. I don’t know if
that was more the language’s fault, or the fault of the programmer’s
background in something like Java. I’m interested in giving it a look
at
some point, but I have other stuff in the queue first. It’s probably
way
back there around the level of Erlang and Forth for me – both of which
are languages about which I’ve heard great things, but are well outside
the range of my aims right now.

from the two of them. It’s not a “petty microsecond dispute” for MRI.
Okay, fair enough.

Python, PHP and Ruby, and the assumption is that they are equally
productive – you’re just trying to assess how much hardware you’re
going to have to throw at it if your customer growth takes off – you’re
going to want the fastest one. Or, more to the point, you’re probably
going to dismiss the slowest one and move on to the other decision factors.

They’re not equally productive in many cases, however. For OOP, I’d
choose Ruby or Python over PHP or Perl any day of the week, because OOP
in Perl is painful, and in PHP is downright suicidal. I’d also choose
Ruby over Python just as quickly, because I find Python just generally
painful – but that’s more personal taste than anything else, and
wouldn’t necessarily dictate my suggestion for someone else that likes
Python.