pg.ddx.io  pljava-dev@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Subject: [Pljava-dev] Problem with jdbc driver
Date: Fri, 17 Sep 2004 16:32:08 +0200
Message-ID: <thhal-0640mAgucUykZxHFiQ1oXsUVgvU1nCg@mailblocks.com> (raw)
In-Reply-To: <1095429361.3193.11.camel@wrk68.caminosca.com>
References: <1095358292.2894.11.camel@wrk68.caminosca.com>
	<4149E74E.5030606@mailblocks.com>
	<thhal-00H8lApeRUykpCG+2lBXjsCA4Zmi3UK@mailblocks.com>
	<1095364686.2894.29.camel@wrk68.caminosca.com>
	<414AC7AC.70905@mailblocks.com>
	<thhal-0LmAmAjOaUykk34LuukYJQcRFsI8LcA@mailblocks.com>
	<1095429361.3193.11.camel@wrk68.caminosca.com>
	<414AF568.10804@mailblocks.com>
	<thhal-06o0mAgmcUyk1jUt6Ea5A0NC7fVhKMn@mailblocks.com>

Daniel,

>I have a question, how much better is the performance of the functions
>if I use the GCJ???
>  
>
That depends on what you're doing. It can range from worse to a lot 
better. If you application creates lots of new connections, drops them, 
and recreates them, the performance increase can be dramatic. Especially 
if you declare the pljava shared object as a preloaded module. If a 
connection pool is utilized, and if your functions execute a great deal 
of code, you may actually get a performance decrease since the Sun JVM 
has a more efficient interpreter and hotspot optimizer. At present, only 
the pljava.jar is compiled into machine code when you use GCJ. Future 
GCJ based versions of PL/Java will be able to compile the jars loaded 
with install_jar() function as well.

If you're dependent on Java 1.5 you will have to wait a while before you 
can use GCJ. At present it's a somewhat incomplete 1.4 version.

Since you bring up performance I get somewhat worried. If you are 
experiencing bad performance, I'd really like to know when. Keep in mind 
though, that using the *client* JDBC driver (the one found at 
jdbc.postgresql.org) from within a PL/Java is something that I strongly 
discourage. You will get severe performance penalties since a new 
postgres process (and if a java function is called, a new JVM) is 
spawned each time you establish a new connection. Further more, the new 
connection is not attached to your session so it uses a completely 
separate transaction.  In contrast, The PL/Java internal JDBC driver 
should show really good performance and execute within the callers 
transaction.

Regards,

Thomas Hallgren







view thread (4+ messages)

Message-ID: <thhal-0640mAgucUykZxHFiQ1oXsUVgvU1nCg@mailblocks.com>
Permalink:  ../thhal-0640mAgucUykZxHFiQ1oXsUVgvU1nCg@mailblocks.com/
Also on:    postgresql.org/message-id/thhal-0640mAgucUykZxHFiQ1oXsUVgvU1nCg@mailblocks.com

 · 

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: pljava-dev@postgresql.org
  Subject: Re: [Pljava-dev] Problem with jdbc driver
  In-Reply-To: <thhal-0640mAgucUykZxHFiQ1oXsUVgvU1nCg@mailblocks.com>

* 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