[concurrency-interest] Question: microbenchmarks sourcecodes

Krzysiek Zaporowski krzysiek.zaporowski at googlemail.com
Wed Nov 28 09:02:42 EST 2007


2007/11/26, Joe Bowbeer <joe.bowbeer at gmail.com>:
> On Nov 24, 2007 2:00 PM, Krzysiek Zaporowski wrote:
> >
> > I'm making microbenchmark that measures ReentrantLock vs synchronized.
> > I've followed advices Brian Goetz presents in his articles, but still
> > I'm receiving strange results - synchronized block seems to be pretty
> > faster. So, now I'm in the point where I don't know what to correct in
> > my benchmark to run it properly. Conceptually it's pretty similar to
> > benchmark proposed by Brian Goetz and Tim Peierls - threads are
> > receiving random numbers in synchronized or lock block.
> > Are there any sourcecodes of microbenchmark proposed? Or maybe someone
> > had done such benchmarks and could show me how to do this properly?
> >
>
> Note that synchronized performance has improved considerably since the
> initial benchmark results were reported:
>
>   Why is reentrant lock faster than synchronized?
>   http://osdir.com/ml/java.jsr.166-concurrency/2005-02/msg00031.html
>
> Btw, are you referring to the following article?
>
>   Java theory and practice: Anatomy of a flawed microbenchmark
>   http://www.ibm.com/developerworks/java/library/j-jtp02225.html
>
> --
> Joe Bowbeer
ok, thx - I've taken synchronized improvements on a account. And yes,
I'm following good advices from this Brian Goetz's article :)


More information about the Concurrency-interest mailing list