SYSK 386: Performance Implications of Using One vs. Several Nested Hashtables

Let’s say you need to quickly find some reference/lookup data and you decide to use hashtables… If your key is comprised of several elements, is it better, from the performance point of view for you to combine all of them into one string and use it to access a flat single hashtable, or, would you be better off with a multi-level lookup?

Without the helper classes, using just hashtables, the two approaches might be represented as follows: