Performance of contains() in a HashSet vs ArrayList | Baeldung
This quick write-up explains the performance of the contains() method of the HashSet and ArrayList collections. With the help of the JMH benchmarking, we've presented the performance of contains() for each type of collection. As a conclusion, we can learn, that the contains() method works faster in HashSet compared to an ArrayList.
DA: 33 PA: 26 MOZ Rank: 85