Re: PreparedStatement parameters and mutable objects - Mailing list pgsql-jdbc

From Paul Thomas
Subject Re: PreparedStatement parameters and mutable objects
Date
Msg-id 20040112132601.A17510@bacon
Whole thread Raw
In response to Re: PreparedStatement parameters and mutable objects  (Oliver Jowett <oliver@opencloud.com>)
Responses Re: PreparedStatement parameters and mutable objects  (Oliver Jowett <oliver@opencloud.com>)
List pgsql-jdbc
On 12/01/2004 00:39 Oliver Jowett wrote:
> Paul Thomas wrote:
>> Having followed this very interesting thread, I'm still wondering
>> exactly how much measurable improvement could be achieved. I read an
>> article on IBM developerWorks (sorry can't remember the URL) which
>> stated that, on modern VMs, things like object creation aren't the
>> performance bogeys that they once were. So I'm thinking that before we
>> make a decision about committing to a change which might break someones
>> app, is there any way by which we could measure the effects of the
>> proposed change?
>
> The problem is that it's very specific to the application workload; what
> case do we measure?

I think you would need something which closely models you app's work load.

> The reason I'm interested in doing this for is not the direct CPU
> overhead of object creation (none of the JDBC code is on our main
> execution path), but the effect that object creation has on GC interval
> and pause. We're running a low-latency app where an extra 50ms pause due
> to GC has a large impact on our latency figures .. so the less garbage
> we generate in the first place, the better. We could farm the JDBC work
> out to a separate VM, but that gets complex quite fast.

Reducing the amount of garbage created is never a bad thing. Do you have
an estimate of the % reduction you think you could achieve?

>
> Aside from the change in behaviour, the change I'm proposing has no real
> downside I can see -- it's not a CPU-vs-memory tradeoff, we're just
> generating fewer intermediate copies altogether. More of a code
> complexity-vs-runtime cost tradeoff I suppose.

Sounds fine to me.

--
Paul Thomas
+------------------------------+---------------------------------------------+
| Thomas Micro Systems Limited | Software Solutions for the Smaller
Business |
| Computer Consultants         |
http://www.thomas-micro-systems-ltd.co.uk   |
+------------------------------+---------------------------------------------+

pgsql-jdbc by date:

Previous
From: Dave Cramer
Date:
Subject: Re: PreparedStatement parameters and mutable objects
Next
From: Conor Beverland
Date:
Subject: setArray()