From: Chad Perrin Date: 2009-02-09T11:17:41+09:00 Subject: Re: Ruby vs Perl performance --rwEMma7ioTxnRzrJ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Feb 08, 2009 at 03:22:20AM +0900, Igor Pirnovar wrote: > Vetrivel Vetrivel wrote: > > I have downloaded perl and ruby program in net.I run both the=20 > > programs.But the Ruby program performance very wost than perl. > > Can any one tell me the reasons and soultion to make ruby as=20 > >faster than perl. I have attached perl program. >=20 >=20 > Ruby and Perl are two totally different programing environments and are= =20 > really not to be compared with regards to their run time performance.=20 > With Ruby the performance issue is shifted to the entire project life=20 > cycle, and indeed to the complexity of the project. Mere execution time= =20 > of an application represents only a tiny fraction of what is truly=20 > measured when comparing procedural language like Perl and object=20 > oriented Ruby. If you compare the two languages in this respect Perl=20 > doesn't come even close to where Ruby stands. In fact I believe if you=20 > look at performance issues from this angle, Ruby stands out very proudly= =20 > as the best performing programming language of all times. You talk as though Perl were something like Java or C++. It's not. Development can be incredibly fast with Perl. It's just suited to different environments and tasks than Ruby. For the most part, it's ridiculous to talk about which language's implementation is faster, in and of itself. The only time runtime performance really matters that much is when you have a specific task for which run time performance is of great specific importance -- and, even at those times, a better algorithm is usually worth a lot more performance gain than a faster language implementation. Because of this, I agree that runtime performance should never be the sole determinant when choosing which language to use for a given project. In many cases, any language in widespread use is going to be fast enough for your needs, and as such runtime performance should be somewhere near the *bottom* of the list of criteria. =2E . . but I really don't agree with your assessment of Perl's development cycle as something that "doesn't even come close" to Ruby's. Furthermore, pigeonholing Perl as a "procedural" language is as unfair to it as pigeonholing Ruby as "object oriented" is to Ruby. Both of them have a lot more to offer. Both provide excellent support for many traditionally functional paradigm programming; both support object oriented development; both can be used in a structured, procedural style when that's the appropriate technique to employ. In general, I enjoy programming in Ruby more, these days -- but there are tasks for which I'd much rather write the code in Perl than in Ruby. Each has its strengths, and each has its place in my development toolkit (and neither of them is clearly "faster" in terms of "the entire project life cycle", especially considering that different projects have very different lifecycles). --=20 Chad Perrin [ content licensed OWL: http://owl.apotheon.org ] Quoth Sean Reifschneider: "If java had real garbage-collection, it would delete most programs before it executed them." --rwEMma7ioTxnRzrJ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.10 (FreeBSD) iEYEARECAAYFAkmPkg8ACgkQ9mn/Pj01uKXLiACgxudKV+diarHbjSMLhANAExze 0c0AnR7El7fe/sJtUBg/HihtcmOnBw2V =H8d5 -----END PGP SIGNATURE----- --rwEMma7ioTxnRzrJ--