Hi Andrei,

Yes, there are a lof of collection libraries around. But licensing issues can 
be a problem and I also don't like external dependencies. So I prefer home-made 
ones.

DIGY.



-----Original Message-----
From: Andrei Alecu [mailto:[email protected]] 
Sent: Wednesday, August 19, 2009 12:26 AM
To: [email protected]
Subject: Re: [jira] Updated: (LUCENENET-190) 2.4.0 Performance in 
TermInfosReader term caching (New implementation of SimpleLRUCache)

An alternative collection library is NGenerics.

See:
http://code.google.com/p/ngenerics/wiki/RedBlackTree
http://code.google.com/p/ngenerics/

There are a bunch of other types of Queues or Trees in it that may be 
useful.


On 8/18/2009 5:12 PM, Digy wrote:
> SortedDictionary does not have a getter with index (like Data[Index]). In a 
> SortedList, Data[0] is always the LRU item.
>
>
> I got much more better results with RedBlackCS.RedBlack ( 
> http://www.codeproject.com/KB/recipes/redblackcs.aspx ) but it is huge and 
> there may be licensing problems.
>
>
> DIGY.
>
>
> -----Original Message-----
> From: [email protected] [mailto:[email protected]]
> Sent: Tuesday, August 18, 2009 4:51 PM
> To: [email protected]
> Subject: Re: [jira] Updated: (LUCENENET-190) 2.4.0 Performance in 
> TermInfosReader term caching (New implementation of SimpleLRUCache)
>
> SimpleLRUCache_LUCENENET_190 uses SortedList<long, object>  collection.
>
> Performance of SortedList (see 
> http://msdn.microsoft.com/en-us/library/ms132339.aspx):
> 1) Add method is an O(n) operation for unsorted data. It is an O(log n) 
> operation if the new element is added at the end of the list.
> If insertion causes a resize, the operation is O(n).
> 2) Remove method method is an O(n) operation
> 3) RemoveAt method is an O(n) operation
> 4) Keys property is an O(1) operation
>
> Why not to use SortedDictionary<>? It has better performance for Remove and 
> Add:
>
> 1) Add method is an O(log n) operation
>
> 2) Remove method is an O(log n) operation
>
> 3) Keys property is an O(1) operation
>
>
>    

Reply via email to