From: Trans Date: 2006-08-22T22:35:19+09:00 Subject: Re: Yet another caching mechanism. The one without the cache. Erik Veenstra wrote: [snip] > The Cache objects are a kind of "delegators-with-cache". > > After our algorithm has finished, we want to get rid of these > Cache objects. That's easy: > > points = points.collect{|point| Cache::Cache.un_cache(point)} > > In short: Don't change the business classes, don't change the > algorithm. Just add one line before the algorithm and one line > after the algorithm. That's it. > > The implementation is easy. In my particular situation, the > speed is more than doubled. Not bad for such a simple thing. > > I don't pretend that this will work in every situation, but it > worked for me. It's _a_ solution for _my_ problem, not _the_ > solution for _any_ problem. > > I just wanted to share... Ruby is fun... ;] That's a nice solution. Thanks! If you don't mind I'd like to add it to Facets. T.