X-Original-To: pgsql-jdbc-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 0FBFB9FB2D4 for ; Thu, 24 Aug 2006 00:24:43 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 15052-05 for ; Thu, 24 Aug 2006 00:24:28 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from jcour.kyon.de (www.ky-on.de [213.9.98.91]) by postgresql.org (Postfix) with ESMTP id 48E099FB285 for ; Thu, 24 Aug 2006 00:24:27 -0300 (ADT) Received: from [10.0.4.2] (gw-cust1497.hkn.net [213.9.96.234]) (AUTH: LOGIN tt, SSL: TLSv1/SSLv3,256bits,AES256-SHA) by jcour.kyon.de with esmtp; Thu, 24 Aug 2006 05:24:27 +0200 id 00072D88.44ED1BEB.00003105 Message-ID: <44ED1BEB.8020705@kyon.de> Date: Thu, 24 Aug 2006 05:24:27 +0200 From: till toenges User-Agent: Thunderbird 1.5.0.5 (Macintosh/20060719) MIME-Version: 1.0 To: pgsql-jdbc@postgresql.org Subject: Re: Some more profiling hotspots References: <20060824030342.82518.qmail@web32003.mail.mud.yahoo.com> In-Reply-To: <20060824030342.82518.qmail@web32003.mail.mud.yahoo.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.235 tagged_above=0 required=5 tests=AWL, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200608/113 X-Sequence-Number: 15640 j.random.programmer wrote: > consistently get very high usage, via new string > creation in the: > > org.postgresql.core.Encoding.decode > > method. Doesn't look like like there is much room for optimization. The jvm may spend a lot of time in this method because it is called often. public String decode(byte[] encodedString, int offset, int length) throws IOException { if (encoding == null) return new String(encodedString, offset, length); return new String(encodedString, offset, length, encoding); } public String decode(byte[] encodedString) throws IOException { return decode(encodedString, 0, encodedString.length); } Till