Posted on

When looking up data in memory from a large collection, a HashSet or Dictionary is much, much faster than looping through an ordinary collection.

This example uses strings – if you run the same code but treat them as GUIDs, the numbers improve quite a bit, but the difference between array and HashSet is still tremendous.

View code on GitHub

Leave a Reply

Your email address will not be published. Required fields are marked *