Re: Some more profiling hotspots

From: "j(dot)random(dot)programmer" <javadesigner(at)yahoo(dot)com>
To: Oliver Jowett <oliver(at)opencloud(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Some more profiling hotspots
Date: 2006-08-24 03:25:16
Message-ID: 20060824032516.61449.qmail@web32002.mail.mud.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Oliver:

Thanks for the quick followup !

I'm actually using a framework that I've developed,
which does
the standard O/R mapping from tables to java objects.

So if I have a table foo:

I automatically get:
table_foo.java and
table_fooMgr.java

The above is generated using via the framework
(internally using
JDBC meta data). This part is NOT profiled. Once the
classes
are generated, JDBC meta data is never used again.

So to actually run the profiled code, I say:
----------------------------------------------
Connection con = ....get connection....
for (int n = 0; n < 100000; n++)
{
table_foo prototype = new table_foo();
prototype.set_column_a(1);
prototype.set_column_b("2");
List rows = table_fooMgr.getUsing(con, proto);
}
-----------------------------------------

That's it in a nutshell. The actual stuff going over
the wire that
the getUsing(...) method above calls is a prepared
statement and
the query looks like:

SELECT column_a, column_b [...] from table_foo
WHERE column_a=1 and column_b='2' [...]

That prepared statement (and the JDBC driver code that
is called) is
what is really profiled under the covers. I know this
is still not very detailed. The only data fetched from
the database is via the
above query.

Unfortunately, it's hard to post the entire code
because there are dependencies on the framework etc.

I'm going to post a link to this framework (it's
really very cool, O/R, a
page templating language, many other cool things) when
I have it up
on the web. In the meantime, forgive my posting
incomplete info...but
at least this will give you a hint as to what's
getting profiled.

I'm running all this on:
JDK 1.5.0_06
postgres 8.1
postgres 8.2dev-503 JDBC 3 driver.

Best regards,
--j

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Oliver Jowett 2006-08-24 04:09:21 Re: Some simple JDBC profiling results
Previous Message till toenges 2006-08-24 03:24:27 Re: Some more profiling hotspots