Query parsing speedup patch

Поиск
Список
Период
Сортировка
От Mikko Tiihonen
Тема Query parsing speedup patch
Дата
Msg-id 1153856101.27322.9.camel@dual.local
обсуждение исходный текст
Список pgsql-jdbc
Hi,

I spent one day trying to to optimise the parsing of ResultSets from the
stream. The attached patch gives around 35% speedup when parsing larger
queries containing equal amount of int4, int8 or varchar columns
assuming the system is CPU bound. I think parsing of other field types
could be similarly optimised.

I also attached the test code which I used to test the performance.

VisibleBufferedInputStream
- from scratch implementation that replaces BufferedInputStream
  * not synchronised
  * allows direct access to the buffer[] avoiding useless copies
    when converting to String
  * has method for scanning the length of next null terminated string

PGStream:
- uses VisibleBuffereInputStream
  * faster implementations for for ReceiveIntegerR and ReceiveString

Encoding, AbstractJdbc2ResultSet
-  parses int and long values directly from byte[] -> number instead
   of first creating a throw-away string



Also, what would you think of patches that change all Vectors to
ArrayList and Hashtables to HashMaps? The difference is not too visible
when benchmarking with one thread and CPU but I believe that in larger
machines the useless synchronisation can slow down the system by
flushing the CPU write buffers. Also JIT could more freely modify the
code when there are less synchronisation points.

Вложения

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

Предыдущее
От: Kris Jurka
Дата:
Сообщение: Re: PreparedStatement clearParameters and setTimestamp
Следующее
От: "alan"
Дата:
Сообщение: Re: Invalid column display size. Cannot be less than zero