The hash set has a lookup complexity of O(1), so having a larger set to look through will not have a huge effect on the comparison. It would be best to have the list to search as big as possible, and the split up the looping through the combinations into separate threads. Ideally you would make a hash set of all the several billion combinations, and search it for each of the 30k items, but I suspect that memory might become an issue there!