tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David kerber <>
Subject Re: Performance with many small requests
Date Tue, 12 May 2009 11:44:22 GMT
Leon Rosenberg wrote:
> On Tue, May 12, 2009 at 6:27 AM, Caldarale, Charles R
> <> wrote:
>>> From: David Kerber []
>>> Subject: Re: Performance with many small requests
>>> Incrementing a counter can't be much of a synchronization bottleneck,
>>> and if I switch to an AtomicInteger, it should be even less of one.
>> Actually, it won't.  There's a slight performance difference between the two mechanisms,
but it's usually in favor of the synchronized increment, not the >AtomicInteger, at least
on my dual-core AMD 64 system running JDK 6u12 in 64-bit server mode on Vista.  The difference
is only a few percent, so you should >just code it whichever way you find more maintainable.
 (Test program available on request; it would be interesting to see if the same relationship
exists on a >modern Intel chip.)
> Hello,
> last time I checked (which is a while ago - 2006 and on 1.5) it was
> not only processor, but also OS dependent and clearly in favor of
> atomics (but it probably depends on the number of concurrent writers
> too). If you would share your test code, I would love to test it on
> some *nixes and darwins I have here; i'd also volunteer to gather and
> publish results from everyone else :-)
I'll second that request!


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message