Received: from p1.selectacast.net (p1.selectacast.net [206.41.1.251]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id f0TNvvq47358 for ; Mon, 29 Jan 2001 18:57:57 -0500 (EST) (envelope-from jks@selectacast.net) Received: from selectacast.net (IDENT:jks@d1 [209.219.91.66]) by p1.selectacast.net (8.9.3/8.9.3) with ESMTP id SAA15695; Mon, 29 Jan 2001 18:57:20 -0500 Message-ID: <3A760360.DA37F1C@selectacast.net> Date: Mon, 29 Jan 2001 18:57:20 -0500 From: Joseph Shraibman Organization: Xtenit, Inc. http://www.xtenit.com X-Mailer: Mozilla 4.76 [en] (X11; U; Linux 2.4.0 i686) X-Accept-Language: en MIME-Version: 1.0 To: Michael Stephenson CC: PostgreSQL jdbc list Subject: Re: [PATCHES] Re: [INTERFACES] Patch for JDBC timestamp problems References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive-Number: 200101/87 X-Sequence-Number: 92 Michael Stephenson wrote: > > On Wed, 24 Jan 2001, Joseph Shraibman wrote: > > > > What was the conclusion of this discussion? Do we leave it static? > > > > No, it cannot be static. > > As I see it we have three possible solutions to this problems. > > a) Just stop it being static, each PreparedStatement gets a new > instantiation (I think this is what we've done for now). > b) static ThreadLocal, each Thread gets one instantiation. But I think some people are still using java 1.1.x and they don't have ThreadLocal. > c) An Object Pool (possibly using SoftReferences to stop memory bloat), > slightly more difficult to code, a lot less instantiations, much > better performance. But there are so many different ones used and you would have to make a pool for each one. > > If people agree that either 'b' or 'c' is a better solution, I'll go ahead > and implement it. I don't agree. Part of java performance is memory usage. Introducing memory pools means keeping objects around forever even if they are used once. In tests I've done to see if using static variables are usful with string parsing I've found that gain is minimal. Any call to postgress will be disk and network bound and trying to introduce a pool will only complicate things. -- Joseph Shraibman jks@selectacast.net Increase signal to noise ratio. http://www.targabot.com