From: | Joseph Shraibman <jks(at)selectacast(dot)net> |
---|---|
To: | Michael Stephenson <mstephenson(at)tirin(dot)openworld(dot)co(dot)uk> |
Cc: | PostgreSQL jdbc list <pgsql-jdbc(at)postgresql(dot)org> |
Subject: | Re: [PATCHES] Re: [INTERFACES] Patch for JDBC timestamp problems |
Date: | 2001-01-29 23:57:20 |
Message-ID: | 3A760360.DA37F1C@selectacast.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-interfaces pgsql-jdbc pgsql-patches |
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(at)selectacast(dot)net
Increase signal to noise ratio. http://www.targabot.com
From | Date | Subject | |
---|---|---|---|
Next Message | Peter T Mount | 2001-01-30 09:04:48 | Re: [INTERFACES] jdbc: v7.1 bug (letter accent) |
Previous Message | djohn8 | 2001-01-29 23:21:21 | Recent posting |
From | Date | Subject | |
---|---|---|---|
Next Message | Peter T Mount | 2001-01-30 08:56:14 | Re: org.postgresql.Serialize |
Previous Message | Richard Bullington-McGuire | 2001-01-29 20:58:40 | Re: Re: Patch for jdbc Makefile |
From | Date | Subject | |
---|---|---|---|
Next Message | Ryan Kirkpatrick | 2001-01-30 04:52:39 | A Sparc/Linux patch (for 7.1), and a Linux rc.d/init.d script.... |
Previous Message | Richard Bullington-McGuire | 2001-01-29 20:58:40 | Re: Re: Patch for jdbc Makefile |