DEV Community 👩‍💻👨‍💻

Joe Enos
Joe Enos

Posted on

Loops vs HashSets

You know that it's faster to find a value in a HashSet rather than a regular collection. But how much faster?

Turns out that looping through a lot of values is pretty slow, while looking up in that same collection as a HashSet is practically instant - tens of thousands of times faster in the example I show here:

Top comments (0)

Head to your account's Settings to...

🌚 Enable dark mode
🔠 Change your default font
📚 Adjust your experience level to see more relevant content