From: Chad Perrin Date: 2006-07-27T08:50:04+09:00 Subject: Re: For performance, write it in C On Thu, Jul 27, 2006 at 08:35:47AM +0900, Sean O'Halpin wrote: > > Chad Perrin said: > >A little extra memory usage does not translate directly to performance > >loss. > > Coming from a background where I had to make everything happen in 48K, > I have to disagree. And it's not always just 'a little extra memory > usage'. Careless use of closures can cripple an application. See the > problems the Rails team encountered. Careless use of ANYTHING can cripple an application. Using an extra kilobyte of memory on a 1GB system for a closure instance or two is not indicative of an inescapable performance cost for the mere fact of the existence of closures. While your point about 48K of RAM is well-taken, it's pretty much inapplicable here: I wouldn't be writing Ruby programs to run in 48K. Hell, my operating system won't run in 48K, nor even a hundred times that (I'm using Debian GNU/Linux Etch/Testing, if that matters). I'm sure as heck not going to expect all my applications to run in that environment. Careless use of pointers can cripple not only the application, but the whole system. Careless use of loops can crash it. Careless use of the power cord can destroy the hardware. In the grand scheme of things, closures are not a good example of a language feature that hinders performance when we're talking about high-level languages such as Ruby. -- CCD CopyWrite Chad Perrin [ http://ccd.apotheon.org ] "It's just incredible that a trillion-synapse computer could actually spend Saturday afternoon watching a football game." - Marvin Minsky