From: | thhal at mailblocks(dot)com (Thomas Hallgren) |
---|---|
To: | |
Subject: | [Pljava-dev] Problem with jdbc driver |
Date: | 2004-09-17 14:32:08 |
Message-ID: | thhal-0640mAgucUykZxHFiQ1oXsUVgvU1nCg@mailblocks.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pljava-dev |
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
From | Date | Subject | |
---|---|---|---|
Next Message | Petr Michálek | 2004-09-19 16:00:24 | [Pljava-dev] java.sql.SQLException: An attempt was made to call a PostgreSQL backend function while main thread was not in the JVM |
Previous Message | Thomas Hallgren | 2004-09-17 11:18:52 | [Pljava-dev] Problem with jdbc driver |