• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Lacs Of objects

 
Ranch Hand
Posts: 295
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 1923
Scala Postgres Database Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 2937
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Scala Postgres Database Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
This tiny ad is wafer thin:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic