Re: new String(byte[]) performance

Поиск
Список
Период
Сортировка
От Aaron Mulder
Тема Re: new String(byte[]) performance
Дата
Msg-id Pine.LNX.4.44.0210221325330.13643-100000@www.princetongames.org
обсуждение исходный текст
Ответ на Re: new String(byte[]) performance  (Barry Lind <blind@xythos.com>)
Список pgsql-jdbc
On Tue, 22 Oct 2002, Barry Lind wrote:
> That is correct.  The FE/BE protocol sends the data back and forth as
> strings for all the data types.  The only exception to this is if you
> are using a 'binary cursor' inwhich case the data is sent in binary,
> (however the byte order is platform dependent, which makes it a pain to
> use binary cursors).

    I think it would be less of a pain to deal with byte
order/endianness than to constantly decode text into numbers.  I mean,
we'd use one routine to read all ints/floats/etc., and it's not hard to
have a flag for whether to read abcd or dcba before we stuff it into an
int/float/whatever.  Java even has the methods to do this (see DataInput
JavaDoc, Float.intBitsToFloat, etc.)  All we need is some indicator of the
native byte order of the server, which could be achieved by sending a
single well-known number in the connection process (you know, the
byte-level analog of "did the server report version 7.3 or 3.7?").
    Truly, one flag for endianness vs creating extra objects for every
numeric value ever read from the server, and getting bugs like can't read
"" as an integer?  Which is really the pain?

    Not that you probably wanted me to agitate for architecture
changes during the beta process... :)

Aaron


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

Предыдущее
От: Teofilis Martisius
Дата:
Сообщение: Re: new String(byte[]) performance
Следующее
От: Barry Lind
Дата:
Сообщение: Re: new String(byte[]) performance