Unnessecary use of new Integer(n) in AbstractJdbc2ResultSet

From: Daniel Migowski <dmigowski(at)ikoffice(dot)de>
To: "pgsql-jdbc(at)postgresql(dot)org" <pgsql-jdbc(at)postgresql(dot)org>
Subject: Unnessecary use of new Integer(n) in AbstractJdbc2ResultSet
Date: 2011-04-23 16:24:26
Message-ID: 41ED3F5450C90F4D8381BC4D8DF6BBDC4F095AFD@EXCHANGESERVER.ikoffice.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Hi,

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!

Regards,
Daniel Migowski

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Kris Jurka 2011-04-25 02:21:43 Re: Unnessecary use of new Integer(n) in AbstractJdbc2ResultSet
Previous Message Bernd Helmle 2011-04-21 15:16:23 Re: Configurable Send/Receive Buffer Sizes