Hello all
The following procedure (explanation follows) works fine for really small lists, but when the list contains a larger number of items (1/2 million) the application enters "not responding" state,and it takes about 2.5 minutes to finish (very bad time). I might add the application needs to process lists of 100 million items at least (eventually).
here is the code for the problematic procedure:
public void removeItems(List<long> L, SortedList<long, List<long>> _subLists)
{
foreach (KeyValuePair<long, List<long>> kvp in _subLists)
{
foreach (long duplicate in kvp.Value)
{
int j = L.IndexOf(duplicate);
L.RemoveRange(j,(int)kvp.Key);
}
}
}
L is a list of long values. _subLists is a sorted list where each value is a list of values from L,starting an arithmetic progression series of some difference (not relevant). the key associated with that value is the length of the series the values contain.
Example:
L = {1,2,3,5,6,7,18,20,21} _subLists = {2,<20>} {3,<1,5>}
The procedure simply removes the arithmetic progression series from L.