Re: setBlob loop performance?

From: "David Wall" <d(dot)wall(at)computer(dot)org>
To: "pgsql-jdbc" <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: setBlob loop performance?
Date: 2002-09-02 16:40:21
Message-ID: 00dc01c2529f$6e1bf980$3201a8c0@expertrade.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

> The fix below only provides half of a fix. If you look further you will
> see that LargeObject.getOutputStream() returns a BlobOutputStream.
> BlobOutputStream extends OutputStream. However BlobOutputStream does
> not override the
> write(byte b[], int off, int len) method. Therefore the default
> implementation in OutputStream is used which still ends up writing one
> byte at a time. To get the desired benefit, you will need to implement
> write(byte b[], int off, int len) in BlobOutputStream to be more
> efficient.

Thanks for the added find. As I mentioned, I wasn't able to test this yet.
On further look at those Blob streams, they also use a default 1k buffer.
I'm not sure if there's a really good size for using the pg server, but of
course if we synced up these default sizes, that would be good (or of course
the other other constructor that sets a 4k buffer, for example, could be
called).

Did you also make the fix into the Blob stream classes or are you looking
for a patch there as well? I was hoping to finally test the changes this
week as our code base is finally ready to run against 7.2.2.

David

Browse pgsql-jdbc by date

  From Date Subject
Next Message David Wall 2002-09-02 17:09:58 Performance of LargeObject.write() with PreparedStatement.setBlob()
Previous Message David Wall 2002-09-02 16:39:21 Re: setBlob loop performance?