pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Joseph Shraibman <jks@selectacast.net>
To: Michael Stephenson <mstephenson@tirin.openworld.co.uk>
Cc: PostgreSQL jdbc list <pgsql-jdbc@postgresql.org>
Subject: Re: [PATCHES] Re: [INTERFACES] Patch for JDBC timestamp problems
Date: Mon, 29 Jan 2001 18:57:20 -0500
Message-ID: <3A760360.DA37F1C@selectacast.net> (raw)
References: <Pine.LNX.4.30.0101250949190.20707-100000@tirin.openworld.co.uk>

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



view thread (28+ messages)  latest in thread

Message-ID: <3A760360.DA37F1C@selectacast.net>
Permalink:  ../3A760360.DA37F1C@selectacast.net/
Also on:    postgresql.org/message-id/3A760360.DA37F1C@selectacast.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 using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: jks@selectacast.net, mstephenson@tirin.openworld.co.uk, pgsql-jdbc@postgresql.org
  Subject: Re: [PATCHES] Re: [INTERFACES] Patch for JDBC timestamp problems
  In-Reply-To: <3A760360.DA37F1C@selectacast.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