From: Kris Jurka <books@ejurka.com>
To: Daniel Migowski <dmigowski@ikoffice.de>
Cc: pgsql-jdbc@postgresql.org <pgsql-jdbc@postgresql.org>
Subject: Re: Unnessecary use of new Integer(n) in AbstractJdbc2ResultSet
Date: Sun, 24 Apr 2011 22:21:43 -0400 (EDT)
Message-ID: <alpine.BSO.2.00.1104242217460.18621@leary.csoft.net> (raw)
In-Reply-To: <41ED3F5450C90F4D8381BC4D8DF6BBDC4F095AFD@EXCHANGESERVER.ikoffice.de>
References: <41ED3F5450C90F4D8381BC4D8DF6BBDC4F095AFD@EXCHANGESERVER.ikoffice.de>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: books@ejurka.com, dmigowski@ikoffice.de
Subject: Re: Unnessecary use of new Integer(n) in AbstractJdbc2ResultSet
In-Reply-To: <alpine.BSO.2.00.1104242217460.18621@leary.csoft.net>
References: <41ED3F5450C90F4D8381BC4D8DF6BBDC4F095AFD@EXCHANGESERVER.ikoffice.de> <alpine.BSO.2.00.1104242217460.18621@leary.csoft.net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox