I have an object that is identified by 3 fields. One them is a String that represents 6 hex bytes, the other two are integers of not more than 1 bytes each. This all summed up is 8 bytes of data, which fits in a 64 bit integer.

I need to map these objects for fast access, and I can think of two approaches:

* Use the 3 fields to generate a 64 bit key used to map the objects. This however would mean parsing the String to Hex for every access (and there will a lot of accesses, which need to be fast).
* Use 3 HashMap levels, each nested inside the next, to represent the 3 identifying fields.

My question is which of these approaches should be the fastest.