From: Oliver Jowett <oliver@opencloud.com>
To: j.random.programmer <javadesigner@yahoo.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Some simple JDBC profiling results
Date: Thu, 24 Aug 2006 16:09:21 +1200
Message-ID: <44ED2671.3070709@opencloud.com> (raw)
In-Reply-To: <20060823195511.93081.qmail@web32004.mail.mud.yahoo.com>
References: <20060823195511.93081.qmail@web32004.mail.mud.yahoo.com>
j.random.programmer wrote:
> I ran a profiler recently on some java code (part of
> which was using
> the postgres JDBC driver) and saw the following
> hotspots within the driver:
>
> org.postgresql.core.Encoding.decode (line: 193)
> org.postgresql.core.Encoding.decode (line: 347)
>
> I think there might be excessive new String creation
> at those points
> cause those 2 lines really light up the profiler.
As pointed out by others there is not "excessive string creation" as
those methods are explicitly designed to return a new String .. The
issue is probably that the callers use it too much. If you attribute the
cost of Encoding.decode() to its callers, what do the hotspots look like
then?
It looks that Encoding.getDatabaseEncoding() actually fails to return
the specialized UTF8Encoding when it could, so we're still using the
generic version (which works, but is slower) .. I suspect I didn't test
that properly when I last modified that code. But if String creation is
really the problem, then that's not going to help you anyway.
-O
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: oliver@opencloud.com, javadesigner@yahoo.com
Subject: Re: Some simple JDBC profiling results
In-Reply-To: <44ED2671.3070709@opencloud.com>
References: <20060823195511.93081.qmail@web32004.mail.mud.yahoo.com> <44ED2671.3070709@opencloud.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