commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Smith" <>
Subject RE: [collections][PATCH] SequencedHashMap violates Map contract, has poor performance -- BufferCache, SequencedHastable, MRUMap and LRUMap .
Date Sun, 03 Feb 2002 22:17:14 GMT
> > 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.

yup.  That's one of the things I mentioned in the documentation (in my
patch).  I even mentioned your example.  :)

> > 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.

doh.  I don't know how I missed that.

Yes, MRUMap does the same thing.  Linked list; O(n) retrieval, O(n)
removal.  Kind of defeats the purpose of using a map at all, doesn't it?


To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message