commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aaron Smuts" <aaron.smu...@verizon.net>
Subject RE: [collections][PATCH] SequencedHashMap violates Map contract, has poor performance -- BufferCache, SequencedHastable, MRUMap and LRUMap .
Date Sun, 03 Feb 2002 21:12:06 GMT


> -----Original Message-----
> From: Michael Smith [mailto:michael@iammichael.org]
> Sent: Sunday, February 03, 2002 11:30 AM
> To: Jakarta Commons Developers List
> Subject: RE: [collections][PATCH] SequencedHashMap violates Map
contract,
> has poor performance -- BufferCache, SequencedHastable, MRUMap and
LRUMap
> .
> 
> > I was talking about the one in cvs.  I was trying to point
> > out that there
> > are other classes that suffer from the same problem that you
> > are fixing and
> > that there are other problems with one of the LRU
> > implementations.  See the
> > other emails.
> 
> ok.  I've looked over some of the classes you mentioned.  LRUMap in
> commons.collections definately suffers the same problems.  I'm about
to
> post a patch for that class that enumerates some of the problems that
I
> saw (I didn't fix them yet -- the patch just changes the license to
the
> proper long form and documents the problems).
> 

The main problem here is that the second most recently used item can get
dropped.  It is not proper LRU.

> Assuming you mean org.apache.turbine.util.BufferCache when you
referred
> to BufferCache, I looked it over as well.  It inherits from
> org.apache.turbine.util.SequencedHashtable which looks to be a near
> exact duplicate of the SequencedHashtable that's in commons.util and
> nearly the same as the SequencedHashMap that exists in
> commons.collections (which is the one I submitted my patch against).
> 
> I can't find any reference to MRUMap.  Can you give me a pointer?
> 

It's in the commons sandbox(?) simplestore.

> The LRUStore you added to stratum looks good to me; however I think
its
> a bit too restricting by requiring contents to be instances of
> ILRUElement and for the keys and values to be Serializable.  Seems
like
> it would work for your needs though.  :)

You can put any object into it.  It just wraps it.  You can override the
wrapper and create something more sophisticated, since you can get the
wrapper out.  You can easily add an expiration and expire on get or
whatever.  

I'll remove the serializable restriction.  That was from the cache.

Cheers,

Aaron

> 
> 
> Overall, yes, there are other classes that suffer from the problem I
was
> fixing with commons.collections.SequencedHashMap.  I'm working on
fixing
> the stuff in commons, since that's what has my interest.  LRUMap is on
> my list of things to fix.  Of course, this all assumes my patches will
> get applied eventually.  :)
> 
> regards,
> michael
> 
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:commons-dev-
> unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:commons-dev-
> help@jakarta.apache.org>



--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message