When we write code in a language like C#, Java, Python or Rust we often have to choose between arrays or lists and hash tables. An array or list stores elements one after another. A hash or dictionary stores elements in locations that are based on the values of the elements themselves (hash codes).
Often we can realize a performance improvement in programs by using hashed collections correctly. If our program loops over an array to find an element by value, it is likely faster to use a hash table instead.
Here are some signs it is worth trying a dictionary:
If a program needs the packed elements in a linear collection, arrays or lists are a better choice. They are more memory-efficient and faster to loop over. But if the program has excessive searching by value, a hash collection is probably an improvement.