Re: setBlob loop performance?
От | David Wall |
---|---|
Тема | Re: setBlob loop performance? |
Дата | |
Msg-id | 00dc01c2529f$6e1bf980$3201a8c0@expertrade.com обсуждение исходный текст |
Ответ на | setBlob loop performance? ("David Wall" <dwall@Yozons.com>) |
Список | 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
В списке pgsql-jdbc по дате отправления: