I'm storing a (possibly large) number of objects in memory that I want to refer to by long
identifiers. Currently, I'm using a standard HashMap<Long, MyClass>
. I was wondering if there might be a better way to do it, since intuitively, I'd think that wrapping long
in a Long
doesn't really make sense.
Note that, as of now, this question is still somewhat academic, so far, I haven't any performance problems with the current solution. It may well be that it never even becomes one. Soon, however, I expect substantial growth in the data I need to process, and I'm starting to compile a list of ideas at what I might want to take a look if things get slow.