I have a very large list of integers (about 2 billion elements) and a list with indices (couple thousand elements) at which i nedd to remove elements from second list. My current approach is to loop over all indices in second list calling RemoveAt() method on first list. However, it takes about 2 minutes to finish. I really need to perform this operation much faster. Is there any way of optimizing this? (I have intel i9X CPU with 10 cores, so maybe some way of parallel processing?)
Remove int elements from a very large list in C#
N K
- 335
- 2
- 4