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 808438B9BF8 for ; Wed, 23 Feb 2005 08:20:28 +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 04420-05 for ; Wed, 23 Feb 2005 08:20:22 +0000 (GMT) Received: from mail24.sea5.speakeasy.net (mail24.sea5.speakeasy.net [69.17.117.26]) by svr1.postgresql.org (Postfix) with ESMTP id 3F7568B9BD0 for ; Wed, 23 Feb 2005 08:20:22 +0000 (GMT) Received: (qmail 14507 invoked from network); 23 Feb 2005 08:20:21 -0000 Received: from dsl093-130-165.sfo4.dsl.speakeasy.net (HELO [192.168.0.42]) (kgeis@[66.93.130.165]) (envelope-sender ) by mail24.sea5.speakeasy.net (qmail-ldap-1.03) with AES256-SHA encrypted SMTP for ; 23 Feb 2005 08:20:21 -0000 Message-ID: <421C3CBE.8020309@speakeasy.net> Date: Wed, 23 Feb 2005 00:20:14 -0800 From: Ken Geis User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.3) Gecko/20040910 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Oliver Jowett Cc: pgsql-jdbc@postgresql.org Subject: Re: Performance tweaks References: <421B0740.3050104@speakeasy.net> <421BAF50.3020701@opencloud.com> In-Reply-To: <421BAF50.3020701@opencloud.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200502/170 X-Sequence-Number: 12350 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.