Re: Re: JDBC Performance

Поиск
Список
Период
Сортировка
От Tim Kientzle
Тема Re: Re: JDBC Performance
Дата
Msg-id 39D3EB28.E39675A4@acm.org
обсуждение исходный текст
Ответ на Re: JDBC Performance  (Tim Kientzle <kientzle@acm.org>)
Список pgsql-general
Gunnar R|nning wrote:
> I think we can improve the performance of the JDBC driver alot still.
> ... The remaining largest bottleneck in my JDBC codebase now is related to
> byte/char conversions in the Sun JDK implementation. My profiler tells me
> that Sun JDK 1.2.2 for some reasons create new instances of the converter
> class every time you do an conversion...

A custom converter may not really help; I experimented with that for
another project and it really didn't make that big of a difference.

You might get some advantage by manually handling the converter object,
keeping a reference to it in the database handle so you don't have to
re-instantiate that class every time. That might help.

You might be able to optimize out some char-to-byte conversions.
For example, if someone "prepares" a SQL statement, you can pre-convert
the entire statement (less placeholders) into bytes, then
convert only the individual arguments; this would speed up
repeated uses of prepared statements.  (I.e., break the original
statement
at ? placeholders, convert each block of static text into bytes,
store the statement as a list of byte[].  When someone executes
a statement, convert just the arguments into bytes and emit the
complete statement.)  I've had very good luck with this strategy
for building and caching mostly-static web pages within Java servlets.

                - Tim

В списке pgsql-general по дате отправления:

Предыдущее
От: Alejandro Federico Pérez López
Дата:
Сообщение: A newbie question
Следующее
От: Alain Black
Дата:
Сообщение: RE: A newbie question