Re: ps.setCharacterStream() and memory usage

From: Oliver Jowett <oliver(at)opencloud(dot)com>
To: Sebastiaan van Erk <sebster(at)sebster(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: ps.setCharacterStream() and memory usage
Date: 2004-11-02 19:45:43
Message-ID: 4187E3E7.9080507@opencloud.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

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

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Vadim Nasardinov 2004-11-02 19:47:54 1300 to 3100 lines of code for XA support (was: Re: plans and estimates for supporting JDBC 3.0)
Previous Message Kris Jurka 2004-11-02 19:39:40 Re: executeBatch() issue with new driver?