Re: Unnessecary use of new Integer(n) in AbstractJdbc2ResultSet - Mailing list pgsql-jdbc

From Kris Jurka
Subject Re: Unnessecary use of new Integer(n) in AbstractJdbc2ResultSet
Date
Msg-id alpine.BSO.2.00.1104242217460.18621@leary.csoft.net
Whole thread Raw
In response to Unnessecary use of new Integer(n) in AbstractJdbc2ResultSet  (Daniel Migowski <dmigowski@ikoffice.de>)
List 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 by date:

Previous
From: Daniel Migowski
Date:
Subject: Unnessecary use of new Integer(n) in AbstractJdbc2ResultSet
Next
From: "Kevin Grittner"
Date:
Subject: Re: Unnessecary use of new Integer(n) in AbstractJdbc2ResultSet