Howdy,
Very interesting.  Thanks for making the changes.  Did you by any chance
carry out benchmarks comparing performance before and after your
changes?

Yoav Shapira
Millennium ChemInformatics


>-----Original Message-----
>From: Mike Bowler [mailto:[EMAIL PROTECTED]]
>Sent: Tuesday, January 21, 2003 10:38 AM
>To: [EMAIL PROTECTED]
>Subject: [PATCH][LANG] Initial collection sizes in Enum.java
>
>The Enum class has some initial collection sizes that aren't terribly
>good for performance.  This patch provides better initial sizes and
>improves one exception message.
>
>The short summary is:
>
>- One HashMap is intended to always be empty but it was created with
the
>default constructor which gives it an initial size of 101.  Changed
this
>to an initial size of 1 which will use less memory.
>
>- The default constructor on HashMap uses a size of 101 which doesn't
>scale very well.  If the collection has to grow to a larger size then
>this starting size quickly becomes non-prime which will degrade
>performance.  A starting size of 89 is better as it remains prime for
>longer.  Changed a couple of places that were using the default
>constructor to use a size of 89.
>
>- One HashMap was created with an initial size of 50.  For best
>performance, you always want the size of the collection to be a prime
>number.  Even numbers will give particularly bad performance.  Changed
>this to 89.
>
>--
>Mike Bowler
>Principal, Gargoyle Software Inc.
>Voice: (416) 822-0973 | Email  : [EMAIL PROTECTED]
>Fax  : (416) 822-0975 | Website: http://www.GargoyleSoftware.com

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to