Re: Using char[] as key in a HashMap

Peter Booth <[email protected]> Wed, 30 Jan 2008 11:10:33 -0500
Newsgroups gmane.comp.windows.devel.java.advanced
Message-ID <[email protected]>
I'm not having a jab at Avinash. He consistently brings fascinating  
material to this mailing list.
And I agree the "bring Everthing" logic isn't always warranted.

But this is an Advanced Java list, and, particularly with performance  
questions, there is a lot of folk wisdom that sounds logical and is  
just plain wrong.

If, for example, Avinash knew his map would always require 10 million  
entries, and each values represented, say, a company name, then  
implicitly we have duplicate values. So we can either have a map with  
perhaps 5000  String objects (as values) or 10 million String objects.

I agree that client vs server is a stretch - but remember the client  
VM will let the heap grow and grow, delaying a full GC as long as  
possible whereas the server VM will run full GCs whenever the heap  
crosses a threshold.


On Jan 30, 2008, at 9:37 AM, Endre Stølsvik wrote:

> Peter Booth wrote:
>> Avinash,
>>
>> Sorry for being a PITA but unless you want us to give folksy wisdom  
>> such
>> as "apple pies are a good thing" you will need to provide a lot more
>> data to answer the question:
>
> I don't quite agree to this notion of "BRING EVERYTHING TO THE TABLE
> FIRST TIME AROUND" logic being the best for every single question:  
> there
> are quite a bit of folksy wisdom on topics like this that can bring  
> the
> requester further. He had some idea himself. Some ideas of where to  
> look
> have already been mentioned in answers.
>
> What has client vs. server really to do with it??
>
> Endre.
>
> ===================================
> This list is hosted by DevelopMentor®  http://www.develop.com
>
> View archives and manage your subscription(s) at http://discuss.develop.com

===================================
This list is hosted by DevelopMentor®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com