I am doing a comparison between two lists of objects using streams (filter/anyMatch) the size of the two lists can be up to a million objects
I ran a test with the code below, Often the size of the two lists is close
if you have any recommendations to improve response time on the code below 🙂
List<String> listDifferences = list1.stream()
.filter(o1 -> list2.stream()
.noneMatch(o2 -> o2.getValue().equals(o1.getValue())))
.map(ObjectValue::getValue).collect(Collectors.toList());
time response for 699839 objects for each list
Fri May 10 16:14:09 CEST 2024
processing ....
Fri May 10 16:33:30 CEST 2024
thank you