Ruby Performance

A

Adrian Howard

On 12 Aug 2005, at 17:36, Lothar Scholz wrote:
[snip]
AH> - Perl 6 now! Many useful things that Perl 5 lacks and that
Perl
AH> 6 will give you like a decent built in OO system, classes as
proper
AH> objects, coroutines, simple block passing, etc. Ruby does now.

Yes thats also going to piss me off. I thought they got a few paid
full time worker on the language (at least one or two from
activestate). But i see almost no progress in Perl 6.

I do. Parrot is an interesting platform for dynamic languages that's
just getting to a reasonable state, and Pugs is just /storming/
along. You can play with large chunks of Perl 6 now.

Cheers,

Adrian
 
A

Adrian Howard

On 12 Aug 2005, at 17:38, Lothar Scholz wrote:
[snip]
Maybe your collegues are maybe better motivated, better paid and
better educated, then the onces i had to work with in the past
(on a very small project - in terms of LOC not of importance for
the company).
[snip]

I'd say a group of poorly motivated, poorly paid and badly educated
developers working on a project of no importance to the company is
doomed whatever language they're working in :)

Adrian
 
A

Adrian Howard

On 12 Aug 2005, at 17:45, Lothar Scholz wrote:
[snip]
AH> Perl's big advantage is that it's a nice flexible language that
AH> enable you to build applications quickly and reliably (despite
what
AH> some people say :)

I think it's biggest advantage is that is is so long out there, that
it just has its market share. And it won that market share via the
sysadmins - for which is was always designed from the beginning.

There are certainly bits of Perl I dislike, and there is much that is
harder than it should be, but given a choice between Java, Perl and
PHP I'd pick Perl almost every time.

Now if you added Ruby or Lisp to the mix I might have to think hard :)

Adrian
 
A

Ara.T.Howard

On 12 Aug 2005, at 17:38, Lothar Scholz wrote:
[snip]
Maybe your collegues are maybe better motivated, better paid and
better educated, then the onces i had to work with in the past
(on a very small project - in terms of LOC not of importance for the
company).
[snip]

I'd say a group of poorly motivated, poorly paid and badly educated
developers working on a project of no importance to the company is doomed
whatever language they're working in :)

i dunno - works for us ;-)

-a
--
===============================================================================
| email :: ara [dot] t [dot] howard [at] noaa [dot] gov
| phone :: 303.497.6469
| Your life dwells amoung the causes of death
| Like a lamp standing in a strong breeze. --Nagarjuna
===============================================================================
 
T

tony summerfelt

Lothar Scholz wrote on 8/12/2005 12:45 PM:
AH> Perl's big advantage is that it's a nice flexible language that
I think it's biggest advantage is that is is so long out there,

i think python has been out there as long as perl has? seems to me i
read that somewhere...

one of the things i really like about ruby is some of the perlisms i
can use like 'if' after another statement:

mylog.trim if mylog.size > 1000

ruby has a pretty good level of tim toadie as we can see with the
cartesian product thread.

i never felt comfortable with python code because i was told the way i
was doing it was always wrong. with ruby i can ease into more consise
ruby code, but still have others ok with my code as it currently stands.
 
K

Kirk Haines

Compared with - say - slashdot?

Performance is a consideration, but it is only one of many. I switched to
Ruby because of tangible reasons -- for web work I could do it under Ruby and
the framework of my choice faster than I could with anything I had experience
in Perl 3 years ago -- and also for intangibles -- as a long time Perl user
at that time, I found Ruby's syntax to be tremendously more enjoyable to work
with than Perl 5's.

But performance is still a factor. I originally had some concern that Ruby
seemed to be slower than Perl. However, as many people have said,
performance only becomes important when it becomes a problem, and it just
isn't a problem with Ruby, for me.

Web benchmarks are notoriously hard, as they are extremely context sensitive.
How much data is being pushed? How much of it is dynamic? What sort of
manipulations have to be done, and how much database interaction must occur?
The answers to these and other questions all affect the results. However, I
have a web app in production right now, written in Ruby, running on a single
processor midrange linux server (no 3.4Ghz P4's here), with a database
backend, being used by a Fortune 500 company. The design spec called for it
to be able to handle 30 requests per second.

In real world usage they have not come anywhere close to that yet, so time
will tell what happens when there is real data in it, but in testing with
current versions of the framework, I am getting as many as 285 requests per
second for a typical 9k HTML page, served through https, with some modest
dynamic content, when feeding it as many requests as I can (.0035 seconds or
less per page).

In real usage, with larger amounts of user data causing long pages with more
dynamic content, this will go down, but I estimate that it will still average
80-100 requests per second, and I did nothing in particular to enhance
performance. In fact, I coded some sections in ways that improved
readability and maintainability at the cost of performance.

Ruby is plenty fast.


Kirk Haines
 
F

Florian Frank

Bradley said:
Those idioms are around 21 seconds each in Ruby.

In perl, its 11 seconds to do this:

for (0..94967295)
{

}

The question is not so much about the run-time of a particular action,
but (in a web-based environment, for example) its more to do with
the number of concurrent users you can have without having to buy
more hardware.

This is much faster in Perl, too:

my $num = 2 ** 65;

my $i = 0;
while ($i < 94967295)
{
$num += 1;
$i += 1;
}

From this benchmark alone, you can see, that Perl is superior to Ruby
in every thinkable way.
 
A

Adrian Howard

On 12 Aug 2005, at 17:52, Chris Martin wrote:
[snip]
Thanks to Rails, I think we'll see Ruby's market share (on the web)
increase drastically in time to come.

I agree.
IMO Ruby (on rails) offers much faster development, and near instant
productivity. That is a great achievement that no other
language/framework can come close to.
[snip]

I think the advantage is more Ruby than Rails if you see what I mean.
Framework wise I feel as productive in one of the perl frameworks as
I do in Rails. The framework isn't the thing that makes Rails
attractive to me, it's Ruby.

What Rails did, and what WTR did to a different audience, was
demonstrate to a whole bunch of people what a really excellent
language Ruby is.

Cheers,

Adrian
 
A

Adrian Howard

On 12 Aug 2005, at 18:41, tony summerfelt wrote:
[snip]
i think python has been out there as long as perl has? seems to me i
read that somewhere...
[snip]

Depends when you start counting.

1987 Perl 1.0
1991 Python 0.9
1991 Perl 4.0
1994 Perl 5.0
1995 Ruby 0.95
1997 PHP 3.0
1998 PHP 4.0
2000 Python 2.0
2003 Ruby 1.8
2004 PHP 5.0

Younger than Perl 1, but older than Perl 5 (which, in my opinion
anyway, was the first version of Perl that you could actually use for
serious applications).

Adrian
 
G

gregarican

Brock said:
This Is My T... O... Way To Do It?

There Is More Than One Way To Do It.

What are the specs of the Windows box you have if it takes 30 seconds
to run 'ruby -v'???
 
Z

zedshaw

Wow, that C program is really fast, especially with the -O3 option.

Too bad there wasn't a way to hook your spiffy ultra-fast C loop into
Ruby. Wouldn't that be great? Some kind of "C" extension thing.

Then, your Ruby (and any language that can 'hook' C) is basically as fast
as C or even Assembler if you really get desperate.

Too bad that didn't exist. Oh well, I guess you'll have to keep testing
these loops and comparing them with Perl.

Zed A. Shaw
http://www.zedshaw.com/
 
R

Rick Nooner

Performance is a consideration, but it is only one of many. I switched to
Ruby because of tangible reasons -- for web work I could do it under Ruby and
the framework of my choice faster than I could with anything I had experience
in Perl 3 years ago -- and also for intangibles -- as a long time Perl user
at that time, I found Ruby's syntax to be tremendously more enjoyable to work
with than Perl 5's.

But performance is still a factor. I originally had some concern that Ruby
seemed to be slower than Perl. However, as many people have said,
performance only becomes important when it becomes a problem, and it just
isn't a problem with Ruby, for me.

In my experience, you should choose a language that you are productive and
comfortable with. Performance issues for any language that cannot be
addressed by changing the algorithims used will be dealt with by rewritting
the appropriate pieces in a lower level language. For scripting languages,
that usually means C. For C, that usually means assembly (at the expense
of portability).

Those performance bottlenecks that must be written in a lower level
language are probably going to be just a small part of the overall program
and will have to be written in a lower level language no matter what
scripting language you are using.

Therefore, being comfortable with the language you are using will lead to
more productivity than language performance factors.

For me, Ruby fits the way I like to program better than any other scripting
language that I am familiar with.
Ruby is plenty fast.

I agree!

Rick
 
G

gabriele renzi

Adrian Howard ha scritto:
On 12 Aug 2005, at 17:36, Lothar Scholz wrote:
[snip]
AH> - Perl 6 now! Many useful things that Perl 5 lacks and that Perl
AH> 6 will give you like a decent built in OO system, classes as proper
AH> objects, coroutines, simple block passing, etc. Ruby does now.

Yes thats also going to piss me off. I thought they got a few paid
full time worker on the language (at least one or two from
activestate). But i see almost no progress in Perl 6.


I do. Parrot is an interesting platform for dynamic languages that's
just getting to a reasonable state, and Pugs is just /storming/ along.
You can play with large chunks of Perl 6 now.

first, let me state that I do have great hopes for parrot, I think perl6
has some very interesting things[1] and pugs is massively cool.

But I think Lothar is right: IMVHO perl6 could have been definitely more
simple, withouth needing ~150 operators[2], special variables like
$?CLASS, ::?CLASS or ::*::Main[3], differentiating multi/method/sub etc



[1] to be fair, I do love multimethods and rules. Real love.
[2] http://www.ozonehouse.com/mark/blog/code/PeriodicTable.pdf
[3] http://svn.openfoundry.org/pugs/docs/quickref/namespace
 
J

Julian Leviston

So use perl already.


Those idioms are around 21 seconds each in Ruby.

In perl, its 11 seconds to do this:

for (0..94967295)
{

}

The question is not so much about the run-time of a particular action,
but (in a web-based environment, for example) its more to do with
the number of concurrent users you can have without having to buy
more hardware.
 
L

luke

Mary Poppins said:
From this benchmark alone, you can see, that Perl is superior to Ruby
in every thinkable way.

Now I want to see you do the chimney sweep dance! Dance! Dance!
 
C

Christopher Aldridge

Mary Poppins said:
=20
=20
Now I want to see you do the chimney sweep dance! Dance! Dance!
=20
=20
=20
=20

GED/J d-- s:++>: a-- C++(++++) ULU++ P+ L++ E---- W+(-) N+++ o+ K+++ w---
O- M+ V-- PS++>$ PE++>$ Y++ PGP++ t- 5+++ X++ R+++>$ tv+ b+ DI+++ D+++
G+++++ e++ h r-- y++**

lol!
 
H

H.P. Gobelli

Il giorno ven, 12/08/2005 alle 23.27 +0900, Bradley Kite ha scritto:
Hi all,

I'm a relatively new Ruby programmer, I am curious as to what Ruby is
trying to achieve that other scripting languages do not already offer (Apart
from the syntactic differences of yet another scripting language, that is).
The reason I ask is that it must offer something that is worth a lot considering
it runs twice as slowly as Perl (see below).

I was also interested in comparing the performance of Ruby against something
like Perl, and (although this test is VERY simple) thought that I'd benchmark
a simple counter in both Ruby and Perl. The number that it counts to
is arbitrary,
I started with 4294967296 and kept reducing it because I got bored of waiting).
Code is provided below.

Any way, on a 3Ghz P4 CPU, I got the following results:

Perl:
real 0m24.569s
user 0m24.499s
sys 0m0.068s

Ruby:
real 0m57.218s
user 0m57.108s
sys 0m0.109s

I think the performance issues will be fixed with the new virtual
machine they are developing, just look at this:

$ time ruby1.8 perf.rb

real 0m57.328s
user 0m52.766s
sys 0m0.178s

$ time ruby1.9 perf.rb

real 0m41.883s
user 0m40.081s
sys 0m0.085s

$ time ruby1.9 -rite perf.rb

real 0m2.528s
user 0m2.351s
sys 0m0.010s


ruby1.9 -rite means run ruby with the new VM,


Regards,

Paolo.
 
T

tony summerfelt

gabriele renzi wrote on 8/12/2005 6:26 PM:
first, let me state that I do have great hopes for parrot,

i hope parrot dies on the vine...but it doesn't look like it's going to
I think perl6 has some very interesting things[1]

it's too bad larry wall caved to the python people. is perl5 ugly? you
betcha :) i like everything about perl, tim toadie, perl magic, line noise

most of the perl code i write on windows is technically perl4, and i
can use a 345k dos executable to run/distribute it. very quick
execution. i have the latest perl5 installed but most of the quick and
dirty stuff i write is 4
 
J

Julian Leviston

what's time toadie?


gabriele renzi wrote on 8/12/2005 6:26 PM:

first, let me state that I do have great hopes for parrot,

i hope parrot dies on the vine...but it doesn't look like it's
going to

I think perl6 has some very interesting things[1]

it's too bad larry wall caved to the python people. is perl5 ugly? you
betcha :) i like everything about perl, tim toadie, perl magic,
line noise

most of the perl code i write on windows is technically perl4, and i
can use a 345k dos executable to run/distribute it. very quick
execution. i have the latest perl5 installed but most of the quick and
dirty stuff i write is 4
 
L

luke

'tim toadie' is how the anagram

tmtowtdi

is pronounced. which stands for "there's more than one way to do it".

it's like the catchy saying for perl, which allows coders to write in
different ways. the jury's out about whether this is great or not, and comes
down to personal choice. ruby is toady itself.

best
luke


Julian Leviston said:
what's time toadie?


gabriele renzi wrote on 8/12/2005 6:26 PM:

first, let me state that I do have great hopes for parrot,

i hope parrot dies on the vine...but it doesn't look like it's
going to

I think perl6 has some very interesting things[1]

it's too bad larry wall caved to the python people. is perl5 ugly? you
betcha :) i like everything about perl, tim toadie, perl magic,
line noise

most of the perl code i write on windows is technically perl4, and i
can use a 345k dos executable to run/distribute it. very quick
execution. i have the latest perl5 installed but most of the quick and
dirty stuff i write is 4
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,608
Members
45,241
Latest member
Lisa1997

Latest Threads

Top