Re: Performance tweaks

From: Ken Geis <kgeis(at)speakeasy(dot)net>
To: Oliver Jowett <oliver(at)opencloud(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Performance tweaks
Date: 2005-02-23 08:20:14
Message-ID: 421C3CBE.8020309@speakeasy.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Oliver Jowett wrote:

> Ken Geis wrote:
>
>> First, in PGStream, I "unrolled" SendInteger4 and SendInteger2, like
>> this:
>>
>> private static final byte[] B4 = new byte[4];
>> public void SendInteger4(int val) throws IOException
>> {
>> B4[0] = (byte) ((val >> 24)&255);
>> B4[1] = (byte) ((val >> 16)&255);
>> B4[2] = (byte) ((val >> 8)&255);
>> B4[3] = (byte) (val&255);
>> pg_output.write(B4, 0, 4);
>> }
>
>
> This isn't safe across multiple PGStreams. Can you try benchmarking
> again with "private final" instead of "private static final"? If that's
> still a win it is probably worth changing.

I tested it more rigorously with this change. Not a win.

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Markus Schaber 2005-02-23 14:57:37 Re: [postgis-devel] JDBC & WKB - 400% overhead
Previous Message Ken Geis 2005-02-22 23:49:11 Re: Performance tweaks