I am concerning that I am developing an application where I need to just validate the data from the hashtables. I have 8 hash tables and I get the data from them and verify it. All 8 hashtables has the same structure. My question is if I put data in 8 hashtables would it be more efficient or if I change it in one hashtable? Each hashtable has around 100 objects.
Thanks in advance.
Yours,
Geek
I agree that in this case the size is so small as to be insignificant.
That said, use a single hash table; otherwise you’d have to do 8 checks to find something, and have the overhead of 8 hash table structures (which by definition have an overhead for the slots used to perform well).
If you are using primitive types (or even just primitive types for keys in a map), I highly recommend the trove high performance collection library (GNU Trove). They are written for high performance computing, and in an environment like android can save you precious memory and compute cycles.
They are not complete drop-in replacements, but have comparable functionality…e.g.