I'm trying to think about efficient ways of maintaining collection of small fixed finite number of objects (few dozens), that will change very frequently (at least few times per second up to few dozen times per second). Is there an existing sorted collection which would have functionality of updating key (ranking) of existing inserted item?
Let's consider following item definition:
public class Item
{
public decimal Ranking { get; private set; }
public IIdentity Identity { get; private set; }
public IOtherInfo OtherInfo { get; private set; }
}
I'll have incoming stream of those items (usually updating Ranking, sometimes invalidating the previous Ranking - that can be e.g. simplified by setting Ranking to 0 or Infinite). There will be just few variations of Identity values (and it can be quickly converted to index 0 to N), the OtherInfo can change (but it can be easily stored in separate look-up array), and most importantly the Ranking will change quickly. I was thinking about SortedCollection, however need for removing and reading item whenever the Ranking changes (which is very often) sounds inefficient.
Any suggestion for collection that allows update of item and its resorting in collection will be appreciated.