From: Aredridel Date: 2005-03-31T01:04:10+09:00 Subject: Re: Poor efficency of Ruby... On Wed, 2005-03-30 at 20:54 +0900, JZ wrote: > Dnia Wed, 30 Mar 2005 20:23:58 +0900, David Heinemeier Hansson napisaƂ(a): > > > Rails does a bunch of start-up magic that makes CGI whole-fully > > unsuitable for anything more than asserting that it works. > > Is it not strange? CGI PHP works quite fast. CGI adapter for pythonic > applications server Webware works even very fast. What's wrong with Ruby > and CGI? If it is so unuitable there should be warnings not to use CGI for > Rails at all. I set up first simple Rails using examples from the web. Why > every request consumes 100% of my AthlonXP 2800+ and takes so meny seconds? > I have enough RAM, fast (RAID stripe) disks. > > It is a pity there is no binary version of mod_ruby for win32. I can find > only source tarballs. :( Comparing apples to oranges. PHP is lightning fast to parse: It's parser-friendly first, and human-friendly second. Python the same. Any use of Ruby where you parse on every step will be a bit slower than PHP or Python for identical code. (I have an easier time optimizing Ruby cleanly though....) Comparing a tiny stub for a persistent app process to the whole Rails app is apples to oranges, too. A fair comparison of Ruby to Webware would likely be to compare IOWA using the CGI stub to Webware using the CGI stub. If you set up Rails as a FastCGI process, you'll see the parsing penalty go away largely. You should be able to find mod_fastcgi or mod_fcgid for windows apache without too much trouble, and as far as I know, lighttpd runs on Windows too. If you're seeing 100% CPU usage for several seconds, though, that doesn't sound right. Even CGI isn't that bad in my experience. You might do a little profiling to see where it spends its time. Ari