Re: Unnessecary use of new Integer(n) in AbstractJdbc2ResultSet

Поиск
Список
Период
Сортировка
От Kris Jurka
Тема Re: Unnessecary use of new Integer(n) in AbstractJdbc2ResultSet
Дата
Msg-id alpine.BSO.2.00.1104242217460.18621@leary.csoft.net
обсуждение исходный текст
Ответ на Unnessecary use of new Integer(n) in AbstractJdbc2ResultSet  (Daniel Migowski <dmigowski@ikoffice.de>)
Список pgsql-jdbc

On Sat, 23 Apr 2011, Daniel Migowski wrote:

> I am using the postgresql driver 8.3-604-jdbc3, and noticed something
> strange in my profiling reports:
>
> In Line 2518 of AbstractJdbc2ResultSet, in function findColumnIndex, there
> is a call to "new Integer(n)", which takes 2% overall time in my app! It
> should be replaced by "Integer.valueOf(n)", because this doesn't create any
> new instances on Integer for the usecase found here!
>

Integer.valueOf appeared in JDK 1.5 and we currently still support JDK
1.4.  There's been talk of ditching 1.4 support, but that hasn't
officially happened yet and isn't something we'd do for older driver
releases.

Kris Jurka

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

Предыдущее
От: Daniel Migowski
Дата:
Сообщение: Unnessecary use of new Integer(n) in AbstractJdbc2ResultSet
Следующее
От: "Kevin Grittner"
Дата:
Сообщение: Re: Unnessecary use of new Integer(n) in AbstractJdbc2ResultSet