• Post Reply Bookmark Topic Watch Topic
  • New Topic

Lacs Of objects  RSS feed

 
Gurpreet Saini
Ranch Hand
Posts: 295
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi there,
Is it feasible to use lacs of object with HashMap utility ?. I have lacs of account objects (1.5 lacs) which are encapsulated with HashMap utility. We had yet not tested the application but please give me your advice regarding this issue . Also please write me if there is any other alternative
thank you,
gurpreet
 
Stefan Wagner
Ranch Hand
Posts: 1923
Linux Postgres Database Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know 'lacs' and my dictionary doesn't know too.
Is is slang?
Is it 'lots'? If yes: is lots=20, 20 000, 20 000 000, 20 000 000 000?
Why don't you write a small testprogramm to test it?
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have this vague notion that "lac" is a Hindi (or other Indian language?) number word meaning 10,000.
 
Gurpreet Saini
Ranch Hand
Posts: 295
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry guys for confusing you. Lakhs corresponds to : 1,00000. Hope any experienced personal might tell the optimization issues regarding hashmap table
thank u
gurpreet
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HashMap is a good choice for large amounts of data if you need to do a lot of lookups. If all you're going to do it iterate over all the items in the Collection, then a List may have less overhead. But if you need to find objects by name, for instance, HashMap is the fastest way to do it. Adding and removing things from a HashMap is going to be a little slower than adding and removing from a LinkedList, for example, but finding things in a LinkedList is very slow.
 
John Smith
Ranch Hand
Posts: 2937
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To further clarify EFH's comments, I should say that the performance of the HashMap put/get (add and retreive an entry) is O(1). That is, it takes the same (very short) amount of time to add or find an entrie, no matter how many entries you have in the HashMap (provided that your hashing function is good to distribute the keys more or less evenly). Such is a beauty of a Map!
 
Stefan Wagner
Ranch Hand
Posts: 1923
Linux Postgres Database Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Gurpreet Saini:
... Lakhs corresponds to : 1,00000. Hope any experienced personal might tell the optimization issues regarding hashmap table

I still don't understand, why you not write a small test-class which uses
150.000 elements.
a) you know how big they are
b) you know how they look like
c) you know the environment where the program will run
at least better than we know.
Perhaps you may generate 150 000 elements with a randomizer.
To tell about alternatives, we would need much more information. But if your test shows, that hashmap is fine and faster as expected and smaller than feared - why bother?
If it is too big/ to small you know what to ask for.
And we might know which problem to solve.
But there are many collections (m) and topics to think of (n) which leads to too much speculation (n*m). Perhaps someone can point to a article about collections in general and java-collections in special.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!