Re: Performance tweaks

Поиск
Список
Период
Сортировка
От Oliver Jowett
Тема Re: Performance tweaks
Дата
Msg-id 421BAB6F.4060205@opencloud.com
обсуждение исходный текст
Ответ на Re: Performance tweaks  (Alan Stange <stange@rentec.com>)
Список pgsql-jdbc
Alan Stange wrote:
> Oliver Jowett wrote:
>
>> Ken Geis wrote:
>>
>>>         byte[][] answer = new byte[l_nf][0];
>>> to
>>>         byte[][] answer = new byte[l_nf][];
>>
>> Gah?! What JVM? Aren't the two forms equivalent?
>
> No.  They aren't.
>
> The first is l_nf+1 objects being created (and array of byte[] with l_nf
> byte[0] entries) and the second is just a single object (an array of
> byte[], with null entries).
>
> Any JVM.  It's the language definition.

Ah, right. The Java multidimensional-array stuff always makes my head hurt..

The change seems obviously better, then, since we promptly go and
replace all the top-level array entries with new values.

-O

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

Предыдущее
От: Vadim Nasardinov
Дата:
Сообщение: "multianewarray" vs. "anewarray" (was: Re: Performance tweaks)
Следующее
От: Oliver Jowett
Дата:
Сообщение: Re: Performance tweaks