I have List<Discount>, containing about 100,000 discount values. Here, Discount is a class, and I have List<Product>one that has about 200,000 entries.
I have for everyone that iterates through all the records List<Product>. For each iteration through the list of products, I take some values ββfrom the product element and add it to the wrapper class. This wrapper class also contains a βDiscountβ field, and for each product I have to go through all the discounts received.
The problem with repeating this list of products is time consuming. What is the best way to do this faster?
I was thinking about binary search, but is it difficult for me to implement it?
Any suggestion on how to do this?
source
share