[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

weakrefs and object caching

tele

10/5/2006 8:22:00 AM

Hi,

i need to memorize in a Cache some object that i identify through a
attribute my_id.
base on some event i update the attributes of the objects in the cache
and when the processing is done i can remove the object from cache.

I found some solution:

The memoizable library that can serialize/deserialize object in memory
or in a file.

then the Weakrefs of ruby stdlib, in particular i've found this link:

http://eigenclass.org/hiki.rb?weakhash+a...


For performance reasons and whatever what do you advise me to do?
examples,solutions, useful link?

thank you

:tele



2 Answers

James Gray

10/5/2006 1:14:00 PM

0

On Oct 5, 2006, at 3:22 AM, tele wrote:

> For performance reasons and whatever what do you advise me to do?
> examples,solutions, useful link?

I wrote a fair amount about memoization in this blog post, including
a full implementation and a weak reference cache:

http://blog.grayproductions.net/articles/2006/01/20/ca...
memoization

Hope that helps.

James Edward Gray II

tele

10/5/2006 1:37:00 PM

0

really interesting!
i've a look

thank you

On Thu, 2006-10-05 at 22:14 +0900, James Edward Gray II wrote:
> On Oct 5, 2006, at 3:22 AM, tele wrote:
>
> > For performance reasons and whatever what do you advise me to do?
> > examples,solutions, useful link?
>
> I wrote a fair amount about memoization in this blog post, including
> a full implementation and a weak reference cache:
>
> http://blog.grayproductions.net/articles/2006/01/20/ca...
> memoization
>
> Hope that helps.
>
> James Edward Gray II
>