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

From: Kris Jurka <books(at)ejurka(dot)com>
To: Daniel Migowski <dmigowski(at)ikoffice(dot)de>
Cc: "pgsql-jdbc(at)postgresql(dot)org" <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Unnessecary use of new Integer(n) in AbstractJdbc2ResultSet
Date: 2011-04-25 02:21:43
Message-ID: alpine.BSO.2.00.1104242217460.18621@leary.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Kevin Grittner 2011-04-25 04:23:37 Re: Unnessecary use of new Integer(n) in AbstractJdbc2ResultSet
Previous Message Daniel Migowski 2011-04-23 16:24:26 Unnessecary use of new Integer(n) in AbstractJdbc2ResultSet