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:22:00 GMT
> From: Berin Loritsch [mailto:bloritsch@apache.org] 
> 
> > 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?


Ok, I see, you explicitly sized the hashmap.  Since I have a
sized and unsized BucketMap, I modified the test case to include
the sized and unsized HashMap (apples to apples):

10,000 iters, 10 threads:
--
BucketMap (5001 buckets) took 280ms
Thats 0.0028ms per operation
Unsized BucketMap (255 buckets) took 691ms
Thats 0.00691ms per operation
Synchronized (sized) HashMap took 471ms
Thats 0.00471ms per operation
Synchronized (unsized) HashMap took 471ms
Thats 0.00471ms per operation


10,000 iters, 20 threads:
--
BucketMap (5001 buckets) took 501ms
Thats 0.002505ms per operation
Unsized BucketMap (255 buckets) took 981ms
Thats 0.004905ms per operation
Synchronized (sized) HashMap took 992ms
Thats 0.00496ms per operation
Synchronized (unsized) HashMap took 1041ms
Thats 0.005205ms per operation


We see that at only 20 simultaneous threads BucketMap comes out
ahead.

As I said, BucketMap has room to improve so it can surpass the
values it is getting now.


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