X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id BE8368B9B90 for ; Tue, 22 Feb 2005 22:16:55 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 32456-10 for ; Tue, 22 Feb 2005 22:16:52 +0000 (GMT) Received: from yass.opencloud.co.nz (yass.opencloud.co.nz [203.79.85.162]) by svr1.postgresql.org (Postfix) with ESMTP id 66D858B9B6A for ; Tue, 22 Feb 2005 22:16:54 +0000 (GMT) Received: from 203-79-104-60.cable.paradise.net.nz ([203.79.104.60] helo=[192.168.0.20]) by yass.opencloud.co.nz with asmtp (Exim 3.35 #1 (Debian)) id 1D3iKo-0004dJ-00; Wed, 23 Feb 2005 11:16:50 +1300 Message-ID: <421BAF50.3020701@opencloud.com> Date: Wed, 23 Feb 2005 11:16:48 +1300 From: Oliver Jowett User-Agent: Mozilla Thunderbird 1.0 (X11/20041228) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Ken Geis Cc: pgsql-jdbc@postgresql.org Subject: Re: Performance tweaks References: <421B0740.3050104@speakeasy.net> In-Reply-To: <421B0740.3050104@speakeasy.net> X-Enigmail-Version: 0.89.5.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.006 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200502/165 X-Sequence-Number: 12345 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. -O