From: | Peter T Mount <peter(at)retep(dot)org(dot)uk> |
---|---|
To: | Joseph Shraibman <jks(at)selectacast(dot)net> |
Cc: | Michael Stephenson <mstephenson(at)tirin(dot)openworld(dot)co(dot)uk>, PostgreSQL jdbc list <pgsql-jdbc(at)postgresql(dot)org> |
Subject: | Re: Re: [PATCHES] Re: [INTERFACES] Patch for JDBC timestamp problems |
Date: | 2001-01-30 13:43:04 |
Message-ID: | 980862184.3a76c4e8bf0e6@webmail.retep.org.uk |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-interfaces pgsql-jdbc pgsql-patches |
Quoting Joseph Shraibman <jks(at)selectacast(dot)net>:
> 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.
True, except the 1.1 & 1.2 implementations are different packages, so you
simply don't do ThreadLocal in 1.1.x
> > 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
>
--
Peter Mount peter(at)retep(dot)org(dot)uk
PostgreSQL JDBC Driver: http://www.retep.org.uk/postgres/
RetepPDF PDF library for Java: http://www.retep.org.uk/pdf/
From | Date | Subject | |
---|---|---|---|
Next Message | Luiz Fernando Sodré | 2001-01-30 14:29:37 | Compiling Perl code |
Previous Message | Michael Stephenson | 2001-01-30 09:39:13 | Re: [PATCHES] Re: [INTERFACES] Patch for JDBC timestamp problems |
From | Date | Subject | |
---|---|---|---|
Next Message | Bruce Momjian | 2001-01-30 16:51:07 | Re: [JDBC] Re: Postgresql and JDBC |
Previous Message | Jean-Francois Burdet | 2001-01-30 11:14:18 | Removing blob using pure JDBC (PG7.1) |
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2001-01-30 14:05:54 | Re: Shared library support for postmaster |
Previous Message | Erik Hofman | 2001-01-30 13:01:37 | Shared library support for postmaster |