From: Eric Hodel Date: 2005-01-23T16:40:00+09:00 Subject: Re: looking at ruby... --Apple-Mail-38--690277565 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; format=flowed On 22 Jan 2005, at 20:03, Sean T Allen wrote: > 1. Can someone point me to benchmarks for ruby vs. other languages, > perl > in particular but others as well would be nice. I found a few using > google > but they all seemed to be from 2001-2002 which makes the numbers > rather out of date as I expect ruby has improved speed wise since > then... Premature optimization is the root of all evil. Ruby is fast enough for everybody here, and its fast enough for basecamphq.com and 43things.com. If you really need something to be fast, use the 90/10 rule. Find the 10% of your code that does all the work, and use RubyInline to optimize it into C. > 2. mod_ruby vs mod_perl. mod_ruby looks from the surface to be pretty > complete... > are there features implemented in mod_perl that mod_ruby lacks? > are there any problems or 'gotchas' with mod_ruby? FastCGI is recommended for Rails deployments, but also works on mod_ruby. There used to be a problem where you could not gracefully restart a mod_ruby enabled server due to memory leakage, but this may no longer exist. > 3. Are there ruby templating engines that are comparable feature-wise > to > perl's Template Toolkit? I looked through raa but didnt really find > anything > that would fit that basic description. In particular the built in > caching for > speed is one area... but the big features here for me are the Plugin > and Filter interfaces for extending the template system. Everybody has written a template tool for Ruby, and ERB (which comes with Ruby) supports caching of 'compiled' templates. Not being familiar with the Template Toolkit, I don't know what to say about it. > 4. perl has a Business::Online module that has various sub-module for > using online payment transaction systems through a unified > interface. > Do similar libraries exist for ruby? There's currently a bounty out for this. > 5. Ruby on rails - Active Records. It looks like a really nice > system... comparable > to Class::DBI in a lot of was... question I have is... what kind of > performance > hit does it incur above using DBI. In the perl universe, we decided > not > to use Class::DBI because of said considerations... AR is plenty fast, and it does not use Ruby's DBI. By plenty fast, I mean basecamphq.com and 43things.com both run off AR, and we don't plan on switching to anything else any time soon. > 6. Marshalling speed... perl has the Storable module which alas is a > tad slow... > how does ruby do in this area? Ruby's Marshal is plenty fast, some time ago there were YAML/ruby/perl/python/etc marshalling benchmarks, and I believe Ruby's Marshal did very well compared to all comers (maybe beating?). Add memcached as an excellent place to store this data and its plenty faster. > 7. Does ruby on rails work only with a cgi interface or does it work > with mod_ruby? WEBrick, CGI, FastCGI and mod_ruby are built in. > That is my first initial round of questions... I can see a number of > ways that > ruby would certainly make our code easier to deal with and understand > as it > makes a lot of the design patterns we use a lot easier to implement, > understand etc. > And we use a good number of objects in perl which are rather heavy to > construct etc. Ruby removes lots of 'code smell' (code that smells like code, where brute force coding is used rather than elegant language) > However, perl does have cpan the breadth and depth of which helps > offset some > of these issues. Most of the perl modules you would use already have Ruby equivalents. > My big concern would be diving into ruby to save time and ease > development in > one area only to have the gains lost in another. Most of your questions seem to be Rails-focused... So I would recommend spending one week, no more, trying out Rails and seeing if it is a fit for your work. With Ruby and Rails, one week is more than sufficient to learn enough about Ruby and Rails to make a well-informed decision. I would wager that it will actually take less than a week, simply because Ruby and Rails are that easy, that fast, and that cool. > Either way, I'm going to be playing around which ruby as like a lot > about it... Excellent! -- Eric Hodel - drbrain@segment7.net - http://segment7.net FEC2 57F1 D465 EB15 5D6E 7C11 332A 551C 796C 9F04 --Apple-Mail-38--690277565 content-type: application/pgp-signature; x-mac-type=70674453; name=PGP.sig content-description: This is a digitally signed message part content-disposition: inline; filename=PGP.sig content-transfer-encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (Darwin) iD8DBQFB81SWMypVHHlsnwQRAmZVAJ9/dw6IUb0kznVag836xwRJG44U/gCffgWU H9Vd12Qp4PCj9x1FKH2+omE= =bUYL -----END PGP SIGNATURE----- --Apple-Mail-38--690277565--