Received: from localhost (pluto.hub.org [200.46.204.4]) by postgresql.org (Postfix) with ESMTP id C58869FA0EE for ; Sun, 5 Nov 2006 03:45:28 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.4]) (amavisd-new, port 10024) with ESMTP id 32422-08 for ; Sun, 5 Nov 2006 03:45:25 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mail63.csoft.net (mail63.csoft.net [205.205.214.4]) by postgresql.org (Postfix) with SMTP id 0FD499F9EF0 for ; Sun, 5 Nov 2006 03:45:26 -0400 (AST) Received: (qmail 23128 invoked by uid 1112); 5 Nov 2006 07:45:25 -0000 Date: Sun, 5 Nov 2006 02:45:25 -0500 (EST) From: Kris Jurka X-X-Sender: books@leary2.csoft.net To: Eberhard Schulte cc: pgsql-jdbc@postgresql.org Subject: Re: Enhancement: toBoolean() and empty String In-Reply-To: <44080934.4030605@pixelboxx.de> Message-ID: References: <44080934.4030605@pixelboxx.de> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200611/25 X-Sequence-Number: 16067 On Fri, 3 Mar 2006, Eberhard Schulte wrote: > 1. Encoding.decode() creates for each empty String a new String object. > Memory is wasted unnecessary. > I have been unable to measure a difference in a test of "SELECT NULL FROM generate_series(1,1000000)" and calling getString for each result. Do you have another test case that shows an impact? > 2. AbstractJdbc2ResultSet.toBoolean(): there is no explicite false check. A > false is produced by an NumberFormatException. Yes, that's a problem. I timed a factor of two or so speedup with your patch. I've extended it to also check for "1" and "0" as strings which will also be common and applied it to cvs. I did not put in the exception for invalid data like "hello". The spec is a little vague about this and since we haven't heard any complaints, I'm inclined to retain backwards compatible behavior. Kris Jurka