Is ruby is faster than all Object oriented Scripting langs

Hello,

I am looking at the couple of scripting languages I found the best
two one is Ruby and other is Python. I want to learn one of these
languages but I dont know the prons and crons of these 2 languages.
But as the 1st look I want to know which one of these languages will
be fast when we are running the application…

Thanks,
Ramu.

[email protected] wrote:

Hello,

I am looking at the couple of scripting languages I found the best
two one is Ruby and other is Python. I want to learn one of these
languages but I dont know the prons and crons of these 2 languages.
But as the 1st look I want to know which one of these languages will
be fast when we are running the application…

Thanks,
Ramu.

Ruby is the slowest executing of all scripting languages. I suggest you
go with python. I’ve studied both languages and I prefer python.

El Sábado, 29 de Marzo de 2008, 7stud – escribió:

Ramu.

Ruby is the slowest executing of all scripting languages. I suggest you
go with python. I’ve studied both languages and I prefer python.

Maybe with YARV virtual machine (integrated in Ruby since 1.9.1 AFAIK)
will
Ruby faster?

On Mar 28, 2008, at 9:36 PM, 7stud – wrote:

Ramu.

Ruby is the slowest executing of all scripting languages.

That’s an amazing bold claim I would never be brave enough to make.
I’m sure we all know Ruby is not as fast as many languages, but anyone
who has studied programming at all knows fundamental truths like:

  • The algorithm counts far more than the language when optimizing for
    speed
  • Speed should be a late concern in most projects
  • It’s generally pretty easy to optimize the 10% of the code where
    speed is actually critical, even if you need to drop down to something
    like C for just that part

I have little doubt that we could find some Python code slower than
equivalent Ruby projects, just as I’m sure we could find some code to
support your claim. I think the key is just to avoid this kind of one-
dimensional thinking in the first place though.

If your going to choose Python because you think it’s faster, I have a
better recommendation: write down all the languages you can think of,
close your eyes, and point. It’s the same (or possibly better)
selection criteria.

Besides we all know C and OCaml smoke Python in speed. :wink:

James Edward G. II

Hi 7Stud,

On Mar 29, 1:36 pm, 7stud – [email protected] wrote:

… I’ve studied both languages and I prefer python.

Posted viahttp://www.ruby-forum.com/.

thems fight’n words :wink:
Just out of curiosity though what makes you prefer Python?
I’m looking into both myself, so i’d appreciate your opinion.

cheers,

Mark R. wrote:

It does seem a somewhat inflammatory statement to make on this list.

Clearly it is a completely subjective argument but i think if you want
incredible performance, C is a pretty good option but if you want to enjoy
writing code and produce code so beautiful that it will make your
grandchildren weep for joy, ruby is the best currently available option.

Well … I beg to differ. If you actually read Beautiful Code, you
will see beautiful code in many languages … even Fortran, IIRC.

It does seem a somewhat inflammatory statement to make on this list.

Clearly it is a completely subjective argument but i think if you want
incredible performance, C is a pretty good option but if you want to
enjoy
writing code and produce code so beautiful that it will make your
grandchildren weep for joy, ruby is the best currently available option.

I guess some grandchildren will argue that the poignancy of python makes
them weep with more joy but i’d think they were in the minority. This
would
be an easily measured and incredibly useful statistic.

On Sat, Mar 29, 2008 at 2:50 PM, Mark W. [email protected]

Benchmarks depend on the application you are testing against.

What kind of application are you doing?

Have you looked at Groovy?

On Mar 28, 2008, at 8:05 PM, [email protected] wrote:

I am looking at the couple of scripting languages I found the best
two one is Ruby and other is Python. I want to learn one of these
languages but I dont know the prons and crons of these 2 languages.
But as the 1st look I want to know which one of these languages will
be fast when we are running the application…

learn them both.

the speed will depend entirely on the application - for instance there
are c-bindings for many libraries in both python and ruby. if the
binding exists for one but not the other your application will be
faster in that one. frankly, if you are learning either one for
‘speed’ you’ve got real troubles - both are 100/10000 time slower than
pure c for cpu intensive tasks. we write ruby because it makes our
minds stop hurting and because it let’s solve problems that we would
not be able to comprehend in other languages, and therefore which
would remain unsolved. python is quite good with regard to this too.

technically speaking you don’t really learn a ‘language’ - you learn
an implementation of a turning machine and use it to solve problems.
the choice if implementation should be determined by

a) what you like.

b) what you require.

i order them that way because very little code gets written when you
hate what you are doing.

kind regards.

a @ http://codeforpeople.com/

Casey Hawthorne wrote:

The last time I looked (November 2007) Groovy was about the slowest
thing out there.

ara.t.howard wrote:

On Mar 28, 2008, at 8:05 PM, [email protected] wrote:

I am looking at the couple of scripting languages I found the best
two one is Ruby and other is Python. I want to learn one of these
languages but I dont know the prons and crons of these 2 languages.
But as the 1st look I want to know which one of these languages will
be fast when we are running the application…

learn them both.

the speed will depend entirely on the application - for instance there
are c-bindings for many libraries in both python and ruby. if the
binding exists for one but not the other your application will be
faster in that one. frankly, if you are learning either one for
‘speed’ you’ve got real troubles - both are 100/10000 time slower than
pure c for cpu intensive tasks. we write ruby because it makes our
minds stop hurting and because it let’s solve problems that we would
not be able to comprehend in other languages, and therefore which
would remain unsolved. python is quite good with regard to this too.

technically speaking you don’t really learn a ‘language’ - you learn
an implementation of a turning machine and use it to solve problems.
the choice if implementation should be determined by

a) what you like.

b) what you require.

i order them that way because very little code gets written when you
hate what you are doing.

kind regards.

a @ http://codeforpeople.com/

Here… Here… As a person new to Ruby with VB, Delphi, & C experience,
you goto love both what you do and what you use to get it done.
Otherwise…, it’s like climing Mauna Kea Hawaii 13K+ from the sea
floor. It’s more work thank it has to be. M2C

tonyd

Mark R. wrote:

I suppose i meant just to say that performance is not a factor i’d use to
choose between python and ruby - i’d pick the one that allowed me to write
code that more clearly expressed my intentions to its most important
audience - myself sometime in the future and other unsuspecting developers.

It might not be your choice but there are those who will use it as a
deciding factor. And that is enough justification for the efforts of the
Ruby 1.9, jRuby and Rubinius teams’ efforts to make Ruby’s performance
competitive with that of the other major scripting languages.

[snip]

Most of the time, choosing a language based on it having the fastest runtime
environment is probably very early premature optimisation.

Those on this list who know me probably realize that “premature
optimisation” is a concept I find difficult to grasp. I’m very familiar
with the philosophies of the great gurus Dijkstra, Hoare, Milner, Knuth,
etc. – I “grew up” with them, so to speak. And I don’t think there’s
anything in their writings that justifies inattention to performance
concerns at any stage in the software development cycle, including
selection of a programming language!

In fact, Dijkstra, in A Discipline of Programming, explicitly calls
out that one must pay attention to the twin concerns of correctness and
efficiency. And, while the hardware is orders of magnitudes faster and
cheaper than it was when Dijkstra wrote that, throwing hardware at an
inefficient design is still not economically viable in the long run and
probably never will be.

On Sat, Mar 29, 2008 at 2:18 PM, M. Edward (Ed) Borasky
[email protected] wrote:

Mark R. wrote:

Those on this list who know me probably realize that “premature
optimisation” is a concept I find difficult to grasp. I’m very familiar
with the philosophies of the great gurus Dijkstra, Hoare, Milner, Knuth,
etc. – I “grew up” with them, so to speak. And I don’t think there’s
anything in their writings that justifies inattention to performance
concerns at any stage in the software development cycle, including
selection of a programming language!

I don’t know Edward or those other guys but I agree.
Starting out one, seemingly linear way may prevent you from – or slow
your progress towards – a different design paradigm that could be
vastly better. (Note, I used “better”, not “faster”). I see this a
lot on how people approach some of the Ruby Q. questions.

Todd

On Sat, Mar 29, 2008 at 6:01 AM, ara.t.howard [email protected]
wrote:

> we write ruby because it makes our minds stop hurting

I would put this right next to the famous “Ruby stands out of your
way” quote (Matz’, right?).
Very nicely put indeed.

Cheers
Robert

http://ruby-smalltalk.blogspot.com/


Whereof one cannot speak, thereof one must be silent.
Ludwig Wittgenstein

On Mar 28, 10:01 pm, “[email protected][email protected] wrote:

Hello,

I am looking at the couple of scripting languages I found the best
two one is Ruby and other is Python. I want to learn one of these
languages but I dont know the prons and crons of these 2 languages.
But as the 1st look I want to know which one of these languages will
be fast when we are running the application…

How did you determine that “the best two” were Ruby and Python if you
“don’t know the pros and cons” of the two languages?

On 29 Mar 2008, at 21:25, Brian A. wrote:

“don’t know the pros and cons” of the two languages?

Of course, one could really confuse the issue by coming in with things
like this:

http://www.tbray.org/ongoing/When/200x/2007/10/30/WF-Results

in light of this:

http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&lang=all

The reason why should confirm many of the responses to this thread.

Absolutely - I suspected I might regret posting that statement. It’s a
bit
extreme and more than a little sycophantic given the circumstances.

Forums such as this seem sometimes to have an effect of making people
take
more extreme points of view than they would in person - there’re few
topics
more boring than a language flame war.

I suppose i meant just to say that performance is not a factor i’d use
to
choose between python and ruby - i’d pick the one that allowed me to
write
code that more clearly expressed my intentions to its most important
audience - myself sometime in the future and other unsuspecting
developers.

Ruby’s expressiveness and flexibility has to some extent been achieved
by
sacrificing performance (this statement would be true for python also).
For
me, those benefits far outweigh the cost. I have the indefensibly
subjective opinion that ruby allows me to enjoy writing code that i
imagine
other people could easily understand - perhaps making children cry isn’t
probably something that i really want now that i’ve considered the
matter
further.

Most of the time, choosing a language based on it having the fastest
runtime
environment is probably very early premature optimisation.

If you have little experience using either, try to learn both and see
which
suits your style.

On Sat, Mar 29, 2008 at 3:40 PM, M. Edward (Ed) Borasky
[email protected]

James G. wrote:

Besides we all know C and OCaml smoke Python in speed. :wink:

So do Pascal and LuaJit (and even Lua).

On Mar 28, 10:16 pm, “M. Edward (Ed) Borasky” [email protected]
wrote:

The last time I looked (November 2007) Groovy was about the slowest
thing out there.

Competition for fastest runs into hardware limits; competition for
slowest seems to have no limits beyond the diminishing patience of
time-keepers.

Don’t go thinking our Groovy programs will necessarily be slower than
our Rebol or Io programs - they definitely have potential! :slight_smile:

http://shootout.alioth.debian.org/gp4sandbox/benchmark.php?test=all&lang=groovy&lang2=io

I really don’t understand the extensive dicussions on such a moot point.
Running the same algorithm on two languages, and running a reasonably
complex application is different. As someone above already stated, get
the
10% and optimize it all you want. The main point will still be getting
the
project out of the door. Frankly, if performance is your primary
requirement, why would you EVER want a scripting language? These are
designed with ease of use in mind, and made from higher level
structures. If
you want core performance, just write Assembly, or if you want (some)
portability, C code. Its been done before all these scripting languages
were
developed, and it can be done now.

The moot point is, that if you can’t get the project out of the door in
your
deadline, would you really need performance?

Ruby is slow… so was C when it came out because everyone was used to
Assembly. But C had its advantages, it was more portable than Assembly,
was
structured, and a slew of other features that just made the "developer"s
life easier, nothing more. What you can do in one language, you can do
in
the other. I’m talking about the results, not the way of doing it.

As far as i see, code in the language you like to work in, know how to
use
it well, far too many people don’t know how to implement the proper
algorithm in the proper place anyway, so care about your tools later
when
you hit a brick wall, but till you hit it, take the fastest route to
your
destination. That is efficiency.

Also, a lot of the books written by a lot of the greats were done at the
time where the hardware was limited, and the common developer required
certain ninja skills to do what they wanted. Now, its a little
different.
You just can’t expect the philosophy of driving a moped to apply to
driving
a ferrari. I’m not saying that you should just write crappy code as you
like, but just that you need to write good solid “code” and worry about
the
language when it gives you a problem. As knuth said, “premature
optimization
is the key to all evil (or atleast most of it) in programming”. – Have
you
had a problem with performance with ruby? with python? Just pick a
language
that you can actually learn, and pick a good book, take some time to use
it
well, design your project well, implement the proper architecture,
datastructures and algorithms and use whatever language you are
comfortable
in.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs