Re: synchronized code

From: Barry Lind <blind(at)xythos(dot)com>
To:
Cc: pgsql-jdbc <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: synchronized code
Date: 2003-01-09 17:08:08
Message-ID: 3E1DAC78.5040303@xythos.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Oliver,

Thanks for your work on this.

However to really get a good idea I think we need to see the results for
other platforms and other jvms. I would like it if we had data from:
sun 1.4 jvm on Solaris (done)
sun 1.3 jvm on Solaris
sun 1.4 jvm on linux
sun 1.3 jvm on linux
ibm 1.3 jvm on linux
gcj jvm on linux
sun 1.4 jvm on windows
sun 1.3 jvm on windows
ibm 1.3 jvm on windows

(Is there a 1.4 IBM out yet, it has been a while since I looked at the
IBM site).

Does anyone have the time to run this on these other platforms?

thanks,
--Barry

Oliver Jowett wrote:
> On Thu, Jan 09, 2003 at 10:40:33AM +1300, Oliver Jowett wrote:
>
>
>>Actual numbers to follow when I'm done.
>
>
> The detailed data (and source) is now at:
>
> http://www.randomly.org/misc/java-allocation-pooling-benchmark.txt
>
> Summary:
>
> With no lock contention:
> Client VM: allocation is about twice as fast as synchronizing.
> Server VM: allocation is about 5% slower than synchronizing.
>
> With lock contention, synchronizing is dramatically slower than allocation
> using either VM type; this effect is worse when multiple CPUs are used.
>
> There's very little difference between allocating a new buffer each time,
> or reusing an buffer via setLength(0), ignoring synchronization. In some
> cases (e.g. 2 cpus with spare capacity) allocating a new object is faster!
>
> There's another effect in here somewhere that's generating some noise.
> (compare "no synchronization" to "synchronized buffer" for one thread --
> sometimes the synchronized version is faster, but they're doing the same
> operations other than synchronization so I'd expect it to be always
> slower). Reviewing the code, this may be due to a different cost in
> accessing locals vs. instance fields. If so this will also affect
> the synchronization vs. allocation case.
>
> ... but enough benchmarking for one day I think!
>
> -O
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)
>

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Anil Amarakoon 2003-01-09 18:03:27 RowSet
Previous Message Felipe Schnack 2003-01-09 11:18:18 Re: synchronized code