Re: isSingleXXX in AbstractJdbc1Statement

From: Oliver Jowett <oliver(at)opencloud(dot)com>
To: Chris Smith <cdsmith(at)twu(dot)net>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: isSingleXXX in AbstractJdbc1Statement
Date: 2004-02-17 22:44:37
Message-ID: 40329955.4040902@opencloud.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Chris Smith wrote:

>>Also please don't reparse on each execution (which is the other thing
>>that isSingleSelect and friends try to avoid)
>
>
> Definitely. I don't plan to repeat the calculation; only to avoid deferring
> it. I think the deferred calculations introduce unnecessary work on every
> execution, just to avoid about 100 processor cycles or so when first parsing
> the query.

Not having benchmarked either approach I can hardly disagree :) Object
creation is a real bugbear in our app so I tend to reflexively avoid it
where I can, even when the direct CPU benefit is dubious.

>>This currently chews a *lot* of
>>CPU on the Java side while executing -- on the order of a 50/50 split
>>between Java and the backend.
>
>
> I'm interested in your ideas on why this is the case. I suspect a lot of it
> may have something to do with building the text form of the parameters to
> inject them into the query (in which case I'm working on solving exactly that
> problem by making these changes).

I can only speculate, since the java profiling tools are so bad -- I'm
yet to get a good CPU profile out of this bit of code. It all *seems*
fairly cheap so I can only guess that it's an accumulation of many small
operations along the way. Object creation doesn't seem to be the root of
the problem, as even with heap settings that avoid GCing frequently it's
chewing CPU the whole time, not just during GCs.

I should really do some more profiling of this area, I've just been
avoiding it because it's so painful to do..

-O

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Chris Smith 2004-02-17 22:52:36 Re: isSingleXXX in AbstractJdbc1Statement
Previous Message E. Zorn (blue2) 2004-02-17 18:08:03 JDBC encodng - like problemöäü