From: Renald Buter Date: 2001-05-08T16:16:04+09:00 Subject: [ruby-talk:14848] Re: Ruby and Web Applications On Mon, May 07, 2001 at 11:15:00PM +0100, ruby-talk@ruby-lang.org wrote: > >===== Original Message From "Guy N. Hurst" ===== > >Jim Freeze wrote: > >> ... > >> However, right now I'm guessing that there would be some performance > >> degredation if I were to switch from php to ruby. > >> But, this is why the post, I can only guess right now > >> and although I am tempted to launch into a new web project > >> with Ruby, instead of php, I would like to hear from others > >> if it is going to be worth it right now. > >> > > > >I converted a site using mysql from PHP to Ruby, and it was > >noticably slower. But then, Perl is noticably slower than PHP, too. > > I have heard mixed reports on whether there is a speed difference. > > What is certain is that if you convert CGI to mod_perl using the > classic Apache::Registry, what you get is slower than PHP. But if > you code explicit handlers in Perl, the gap at least narrows > significantly, and memory use improves. > > With Ruby I predict the same holds. Additionally for CGI, people > who use << to incrementally build strings are likely to get > significantly better performance than those who create large > numbers of small objects, or who do unneeded copying with +=. But unfortunately, string concatenation is not _that_ fast (about 1 ms on my P133, albeit with profiling on), so be careful with these if you intend to do a lot (say, a hundred thousand concatenations ;). I agree with not using +=, since I noticed GC-ing about a thousand object seems to get quite a job on such a machine :/ > > What it really comes down to is this, "Is it fast enough for you, > and is it maintainable in its current form?" > Sure thing, but having Ruby to be at odds with PHP, Perl and the like wrt speed, eases the pain of having to introduce yet another scripting language to your sysadmin or management --- although superficial it may be. And thus, speed should be somewhat of an issue for a scripting language -- just as memory management should be. It simply are the properties they get judged upon at first glance, like looks on a human :) Renald