Re: JDBC Overhead - Mailing list pgsql-jdbc

From Oliver Jowett
Subject Re: JDBC Overhead
Date
Msg-id 44D01D40.9090002@opencloud.com
Whole thread Raw
In response to JDBC Overhead  ("Bob Damato" <bob_damato@coxtarget.com>)
List pgsql-jdbc
Bob Damato wrote:

> -------------------------------------------------------
> ps = con.prepareStatement("SELECT 1");
> long execStart = System.currentTimeMillis();
> rs = ps.executeQuery();
> System.err.println ("Query executed in " + (System.currentTimeMillis() -
> execStart) + "ms");
> --------------------------------------------------------
>
> Result of this code is:
> Query executed in 57ms

Try a better benchmark, what you are probably measuring there is mostly
classloading, JIT, and similar startup costs. How long does it take on
the 1000th execution?

Also, unless you are specifically measuring query time when reexecuting
the same PreparedStatement many times, you should include the cost of
prepareStatement() in your measurements.

-O

pgsql-jdbc by date:

Previous
From: "Guy Rouillier"
Date:
Subject: Re: JDBC Overhead
Next
From: ron
Date:
Subject: Re: Callablestatement's resulting resultset not scrollable