Re: JDBC Overhead

Поиск
Список
Период
Сортировка
От Oliver Jowett
Тема Re: JDBC Overhead
Дата
Msg-id 44D01D40.9090002@opencloud.com
обсуждение исходный текст
Ответ на JDBC Overhead  ("Bob Damato" <bob_damato@coxtarget.com>)
Список 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 по дате отправления:

Предыдущее
От: "Guy Rouillier"
Дата:
Сообщение: Re: JDBC Overhead
Следующее
От: ron
Дата:
Сообщение: Re: Callablestatement's resulting resultset not scrollable