From: patrick-may@... (Patrick May) Date: 2002-05-24T02:28:42+09:00 Subject: Re: Stymied by Ruby's garbage collector Matthew Bloch wrote in message news:... > Bob Hutchison wrote: > > > On 5/22/02 4:07 PM, "Art Taylor" wrote: > > > >> Is there a particular kind or kinds of object being created in huge > >> numbers? Can you pool those and reuse them rather than throwing them > >> away? > >> > >> -a. > > > > This is the optimisation that has had the largest impact on programs I've > > written in Eiffel, Java, and Smalltalk. These all have much fancier GC > > systems that Ruby 1.6 and it still makes a big difference. > > Sure, that does make sense but I feel it's a bit against the grain of a > garbage-collected language to have to alter your code to accommodate it :-) > I'd rather put the same effort (in fact I intend to) into fixing Ruby's > garbage collection to work more smoothly. A gc language prevents memory leaks, it makes no performance guarantees :-) Anyway, this is similar to the Flyweight pattern on da wiki: http://www.c2.com/cgi/wiki?FlyweightPattern ~ Patrick