Ruby Impressions

Lulu of the Lotus-Eaters mertz at gnosis.cx
Fri Jan 11 15:25:24 EST 2002


|interestingly none of the comparisons I've seen seem to mention the
|obvious comparisons. Any one know when Python wins/loses to Ruby in
|speed/resource usage.

An anecdotal case.  I wrote a full-text indexing program in Python
(details at http://www-106.ibm.com/developerworks/library/l-pyind.html).
My intention in writing it was solely to produce code that was clear in
its illustration of principles of indexing, speed was really not a
concern.  That said, I think I've used Python enough that I intuitively
avoid some obvious performance pitfalls.  But if it ever came to a
choice between clarity and speed, clarity won.

I've had a couple users comment with their pleasant surprise about the
performance of my utility.  One user, in particular, wrote me to let
me know he wanted to rewrite the utility in Ruby in order to increase
performance.  I encouraged this, with the usual warnings about
benchmarks, and the above sort of comment on my programming design.

This user went ahead with his rewrite, with performance a particular
focus in his programming.  The end result was that the performance was
about the same.  Timing a couple different elements of the operation of
the utility produced mixed wins between Ruby and Python; but the
differences were moderate in any case.  In the end, he gave up on the
Ruby version because Ruby lacked some of the support modules that were
useful when encorporating the indexing into a larger application.

I like Ruby well enough, and encourage folks to learn it.  I've only
really glanced at it myself, but plan to play with it more.  However, a
certain claim by some Ruby advocates--that it is dramatically faster
than Python--seems to be fairly clearly false.

--
 mertz@   _/_/_/_/_/_/_/ THIS MESSAGE WAS BROUGHT TO YOU BY:_/_/_/_/ v i
gnosis  _/_/                    Postmodern Enterprises         _/_/  s r
.cx    _/_/  MAKERS OF CHAOS....                              _/_/   i u
      _/_/_/_/_/ LOOK FOR IT IN A NEIGHBORHOOD NEAR YOU_/_/_/_/_/    g s





More information about the Python-list mailing list