pg.ddx.io pgsql-jdbc@postgresql.org mailing list archive
help / color / mirror / Atom feedRe: [pgsql-jdbc] Daily digest v1.2821 (7 messages)
2+ messages / 2 participants
[nested] [flat]
* Re: [pgsql-jdbc] Daily digest v1.2821 (7 messages)
@ 2011-04-04 21:26 John Lister <john.lister@kickstone.com>
2011-04-04 22:28 ` Re: [pgsql-jdbc] Daily digest v1.2821 (7 messages) Oliver Jowett <oliver@opencloud.com>
0 siblings, 1 reply; 2+ messages in thread
From: John Lister @ 2011-04-04 21:26 UTC (permalink / raw)
To: pgsql-jdbc; bubba.postgres@gmail.com; rsmogura@softperience.eu
I've also (many years ago) a binary patch specifically for arrays, I
also rewrote the text version as well to be much more efficient (at the
time there was significant speed ups). I should get around to cleaning
it up and submitting it - maybe along with the others....
One thing you can do is replace StringBuffer with StringBuilder which
doesn't do synchronisation and is faster, which is something that could
be done throughout the driver as at the time I couldn't find any shared
instances - but requires java1.5
John
On 04/04/2011 22:20, pgsql-jdbc-owner@postgresql.org wrote:
> Mess
> Date: Sun, 3 Apr 2011 22:40:41 +0200
> From: =?utf-8?q?Rados=C5=82aw_Smogura?=<rsmogura@softperience.eu>
> To: pgsql-jdbc@postgresql.org
> Cc: bubba postgres<bubba.postgres@gmail.com>
> Subject: Re: JDBC4 Binary Mode with Arrays
> Message-ID:<201104032240.41399.rsmogura@softperience.eu>
>
> bubba postgres<bubba.postgres@gmail.com> Friday 01 April 2011 20:44:32
>> Sorry for the cross post, I put this on general first:
>>
>> In my current application I am sending a lot of data to/from the DB with
>> JDBC, and specifically arrays of Double. (or even Double[][]).
>> I have been converting everything into a string representation of the array
>> with StringBuffer, which eats a lot of memory.
>>
>> I note that there is this web page:
>> http://wiki.postgresql.org/wiki/JDBC-BinaryTransfer
>>
>> Which made me think I might be saved.
>>
>> After trying out the JDBC4 driver in DBCP, I see that
>> Connection.createArray(...) still just creates a big string under the
>> covers. Is that the expected behavior? Am I doing it wrong?
>> Will the String get converted to binary representation again before hitting
>> the wire?
>>
>> Regards,
>> -JD
> I developed some experimental driver, with support for binary mode, and it's
> only supported mode right now. I'll be glad if You try it:
> http://softperience.eu/pages/cmn/ngpgjdbc.xhtml
>
> Regards,
> Radoslaw Smogura
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: [pgsql-jdbc] Daily digest v1.2821 (7 messages)
2011-04-04 21:26 Re: [pgsql-jdbc] Daily digest v1.2821 (7 messages) John Lister <john.lister@kickstone.com>
@ 2011-04-04 22:28 ` Oliver Jowett <oliver@opencloud.com>
0 siblings, 0 replies; 2+ messages in thread
From: Oliver Jowett @ 2011-04-04 22:28 UTC (permalink / raw)
To: John Lister <john.lister@kickstone.com>; +Cc: pgsql-jdbc; bubba.postgres@gmail.com; rsmogura@softperience.eu
On 5 April 2011 09:26, John Lister <john.lister@kickstone.com> wrote:
> One thing you can do is replace StringBuffer with StringBuilder which
> doesn't do synchronisation and is faster, which is something that could be
> done throughout the driver as at the time I couldn't find any shared
> instances - but requires java1.5
Uncontended synchronization is very cheap on modern JVMs. (Not that we
shouldn't use StringBuilder if we can, but I doubt it'll make a
measurable difference)
Oliver
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2011-04-04 22:28 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2011-04-04 21:26 Re: [pgsql-jdbc] Daily digest v1.2821 (7 messages) John Lister <john.lister@kickstone.com>
2011-04-04 22:28 ` Oliver Jowett <oliver@opencloud.com>
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