commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Juozas Baliuka" <bali...@centras.lt>
Subject Re: [Collections] StaticBucketMap not thread safe
Date Wed, 26 Jun 2002 20:34:01 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.

start1();//allocates "large array"
start2();

start1 has more chances, it sometimes deragmentates memory for array
allocation

> > 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
>

this will test "hash()" function, they are same in SUN's jdk1.3 in
BucketMap, but  not  in jdk1.4

>
> ??  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>
>


--
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