pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Oliver Jowett <oliver@opencloud.com>
To: Sebastiaan van Erk <sebster@sebster.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: ps.setCharacterStream() and memory usage
Date: Wed, 03 Nov 2004 08:45:43 +1300
Message-ID: <4187E3E7.9080507@opencloud.com> (raw)
In-Reply-To: <20041102150849.GB12903@sebster.com>
References: <20041029115651.GE4199@sebster.com>
	<200411020946.09434@vadim.nasardinov>
	<20041102150849.GB12903@sebster.com>

Sebastiaan van Erk wrote:

> This is indeed part of the code I was talking about. And indeed a
> StringBuffer is already a definate improvement.
> 
> However, the setString() method will also cause the data to be duplicated
> when escapeString() is called. A version of escapeString() which works
> on a StringBuffer would be another improvement in my opinion, saving
> (if the allocated StringBuffer is made a bit larger to allow for the
> escaping), in most cases another allocation of the whole string.

I would point out again that this is all different in the current 
development driver. escapeString() no longer exists, and the V3 protocol 
path does not do any additional string escaping as the string is passed 
directly as a parameter in a Bind message.

There's still much scope for improvement, but I'd strongly suggest you 
use the development driver as a starting point.

-O



view thread (6+ messages)

Message-ID: <4187E3E7.9080507@opencloud.com>
Permalink:  ../4187E3E7.9080507@opencloud.com/
Also on:    postgresql.org/message-id/4187E3E7.9080507@opencloud.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 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, sebster@sebster.com
  Subject: Re: ps.setCharacterStream() and memory usage
  In-Reply-To: <4187E3E7.9080507@opencloud.com>
  References: <20041029115651.GE4199@sebster.com> <200411020946.09434@vadim.nasardinov> <20041102150849.GB12903@sebster.com> <4187E3E7.9080507@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