pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kris Jurka <books@ejurka.com>
To: Eberhard Schulte <esc@pixelboxx.de>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Enhancement: toBoolean() and empty String
Date: Sun, 5 Nov 2006 02:45:25 -0500 (EST)
Message-ID: <Pine.BSO.4.63.0611050210320.1524@leary2.csoft.net> (raw)
In-Reply-To: <44080934.4030605@pixelboxx.de>
References: <44080934.4030605@pixelboxx.de>



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



view thread (2+ messages)

Message-ID: <Pine.BSO.4.63.0611050210320.1524@leary2.csoft.net>
Permalink:  ../Pine.BSO.4.63.0611050210320.1524@leary2.csoft.net/
Also on:    postgresql.org/message-id/Pine.BSO.4.63.0611050210320.1524@leary2.csoft.net

 · 

reply

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, esc@pixelboxx.de
  Subject: Re: Enhancement: toBoolean() and empty String
  In-Reply-To: <Pine.BSO.4.63.0611050210320.1524@leary2.csoft.net>
  References: <44080934.4030605@pixelboxx.de> <Pine.BSO.4.63.0611050210320.1524@leary2.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