You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Olivier Lamy <LA...@accor-hotels.com> on 2003/12/04 16:58:55 UTC

RE : [Collections] Difference between HashMap and FastHashMap

As I understand in the javadoc 
http://jakarta.apache.org/commons/collections/api/org/apache/commons/col
lections/FastHashMap.html
 
A customized implementation of java.util.HashMap designed to operate in
a multithreaded environment where the large majority of method calls are
read-only, instead of structural changes

-----Message d'origine-----
De : Bhanu Pabreja [mailto:pabreja@infigroup.com] 
Envoyé : jeudi 4 décembre 2003 16:49
À : Jakarta Commons Users List
Objet : [Collections] Difference between HashMap and FastHashMap



Hi All, 

Can anybody throw me a light on the difference between these 
implementations. I tried to read but actually could not understand the 
difference. 

If someone can explicity tell me it will really be nice and will put
light 
on to my mind. 

Thanx in advance. 

Bhanu Pabreja 


--------------------------------------------------------------------- 
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org 
For additional commands, e-mail: commons-user-help@jakarta.apache.org 



This e-mail, any attachments and the information contained therein ("this message") are confidential and intended solely for the use of the addressee(s). If you have received this message in error please send it back to the sender and delete it. Unauthorized publication, use, dissemination or disclosure of this message, either in whole or in part is strictly prohibited.
********************************************************************** 
Ce message électronique et tous les fichiers joints ainsi que  les informations contenues dans ce message ( ci après "le message" ), sont confidentiels et destinés exclusivement à l'usage de la  personne à laquelle ils sont adressés. Si vous avez reçu ce message par erreur, merci  de le renvoyer à son émetteur et de le détruire. Toutes diffusion, publication, totale ou partielle ou divulgation sous quelque forme que se soit non expressément autorisées de ce message, sont interdites.
********************************************************************** 



RE: RE : [Collections] Difference between HashMap and FastHashMap

Posted by Bhanu Pabreja <pa...@infigroup.com>.
Thanx this was the kind of explanation I was looking for. Thanx a lot and if
you have some more comments please
do let me know. It really helps sometimes for someone who is not so new.

Regards,

Bhanu Pabreja.

-----Original Message-----
From: Stephen Colebourne [mailto:scolebourne@btopenworld.com]
Sent: Friday, December 05, 2003 1:42 PM
To: Jakarta Commons Users List
Subject: Re: RE : [Collections] Difference between HashMap and
FastHashMap


A FastHashMap is not faster than a HashMap, but it can be faster than a
Synchronized HashMap. The FastHashMap allows reads to proceed at roughly
normal performance, but writes will take longer because they involve
synchronization and copying.

Stephen


From: "__matthewHawthorne" <ma...@phreaker.net>
> Bhanu Pabreja wrote:
> > can u give me a use case where using a FastHashMap would
> > be a better idea then the regular HashMap. Also exactly at what stage
the
> > flag should be set to true which will give the performance boost "FAST"
and
>
> If you really want to see what goes on under the hood, I would suggest
> taking a look at the code.
>
> As far as use cases, a good start would be to identify places and
> situations where your HashMaps are being used read-only.  If possible,
> you could start using it there and see if you notice a performance
> difference.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: RE : [Collections] Difference between HashMap and FastHashMap

Posted by Stephen Colebourne <sc...@btopenworld.com>.
A FastHashMap is not faster than a HashMap, but it can be faster than a
Synchronized HashMap. The FastHashMap allows reads to proceed at roughly
normal performance, but writes will take longer because they involve
synchronization and copying.

Stephen


From: "__matthewHawthorne" <ma...@phreaker.net>
> Bhanu Pabreja wrote:
> > can u give me a use case where using a FastHashMap would
> > be a better idea then the regular HashMap. Also exactly at what stage
the
> > flag should be set to true which will give the performance boost "FAST"
and
>
> If you really want to see what goes on under the hood, I would suggest
> taking a look at the code.
>
> As far as use cases, a good start would be to identify places and
> situations where your HashMaps are being used read-only.  If possible,
> you could start using it there and see if you notice a performance
> difference.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: RE : [Collections] Difference between HashMap and FastHashMap

Posted by __matthewHawthorne <ma...@phreaker.net>.
Bhanu Pabreja wrote:
> can u give me a use case where using a FastHashMap would
> be a better idea then the regular HashMap. Also exactly at what stage the
> flag should be set to true which will give the performance boost "FAST" and

If you really want to see what goes on under the hood, I would suggest 
taking a look at the code.

As far as use cases, a good start would be to identify places and 
situations where your HashMaps are being used read-only.  If possible, 
you could start using it there and see if you notice a performance 
difference.


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


RE: RE : [Collections] Difference between HashMap and FastHashMap

Posted by Bhanu Pabreja <pa...@infigroup.com>.
This is what I also read but what internally happens which makes it work
fast I mean the if you do not set it to fast mode with a flag what is the
implementation and can u give me a use case where using a FastHashMap would
be a better idea then the regular HashMap. Also exactly at what stage the
flag should be set to true which will give the performance boost "FAST" and
also i u can spell a example it will be great.
I really wanna know what goes inside the hood cause in my project we have
like HashMaps used in whole sale and I want to see where I can really make a
difference.

Thanx in advance.

Bhanu Pabreja

-----Original Message-----
From: Olivier Lamy [mailto:LAMY_Olivier@accor-hotels.com]
Sent: Thursday, December 04, 2003 10:59 AM
To: 'Jakarta Commons Users List'
Subject: RE : [Collections] Difference between HashMap and FastHashMap


As I understand in the javadoc
http://jakarta.apache.org/commons/collections/api/org/apache/commons/col
lections/FastHashMap.html

A customized implementation of java.util.HashMap designed to operate in
a multithreaded environment where the large majority of method calls are
read-only, instead of structural changes

-----Message d'origine-----
De : Bhanu Pabreja [mailto:pabreja@infigroup.com]
Envoyé : jeudi 4 décembre 2003 16:49
À : Jakarta Commons Users List
Objet : [Collections] Difference between HashMap and FastHashMap



Hi All,

Can anybody throw me a light on the difference between these
implementations. I tried to read but actually could not understand the
difference.

If someone can explicity tell me it will really be nice and will put
light
on to my mind.

Thanx in advance.

Bhanu Pabreja


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org



This e-mail, any attachments and the information contained therein ("this
message") are confidential and intended solely for the use of the
addressee(s). If you have received this message in error please send it back
to the sender and delete it. Unauthorized publication, use, dissemination or
disclosure of this message, either in whole or in part is strictly
prohibited.
**********************************************************************
Ce message électronique et tous les fichiers joints ainsi que  les
informations contenues dans ce message ( ci après "le message" ), sont
confidentiels et destinés exclusivement à l'usage de la  personne à laquelle
ils sont adressés. Si vous avez reçu ce message par erreur, merci  de le
renvoyer à son émetteur et de le détruire. Toutes diffusion, publication,
totale ou partielle ou divulgation sous quelque forme que se soit non
expressément autorisées de ce message, sont interdites.
**********************************************************************




---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org