commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Berin Loritsch" <blorit...@apache.org>
Subject RE: [Collections] StaticBucketMap not thread safe
Date Wed, 26 Jun 2002 20:26:48 GMT
> From: Juozas Baliuka [mailto:baliuka@centras.lt] 
> 
> 
> 1) You must not test Maps in the same process, the first 
> started is faster, because of memory usage.

Could you clarify this one for me?  I'm not sure I got it.

> 2) "InitialCapacity" must be the same.

Which is why I just added a second Synchronized HashMap. i.e.
the sized version and the unsized version.

> 3) Maps must be tested with both "random" and "random_or_not" * x


??  Again could you clarify?

It probably would have been easier to see with a diff.


> 
> this is with 100 threads:
> 
>    [junit] Synchronized HashMap took 875ms
>     [junit] Thats 8.75E-4ms per operation
>     [junit] BucketMap (5001 buckets) took 609ms
>     [junit] Thats 6.09E-4ms per operation
>     [junit] Unsized BucketMap (255 buckets) took 1157ms
>     [junit] Thats 0.001157ms per operation



So BucketMap (when properly sized) is faster than the
equiv. HashMap under load.

> 
> 
> 
> > > From: Juozas Baliuka [mailto:baliuka@centras.lt]
> > >
> > >
> > > I modified test, both tests show nothing, but this shows how to 
> > > write "bad" and "good" performance tests :)
> > > Output:
> >
> > And what's different besides the number of threads?
> >
> > The BucketMap is designed for server environments (i.e. servlet
> > environments) where having 40-100 threads of execution 
> using one map.
> >
> > So how is only 10 better than 100?
> >
> >
> > --
> > To unsubscribe, e-mail:
> <mailto:commons-dev-unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail:
> <mailto:commons-dev-help@jakarta.apache.org>
> >
> 
> 
> --
> To unsubscribe, e-mail:   
> <mailto:commons-dev-> unsubscribe@jakarta.apache.org>
> For 
> additional commands, 
> e-mail: <mailto:commons-dev-help@jakarta.apache.org>
> 


--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message