Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id C256B9FBC50 for ; Wed, 28 Feb 2007 02:08:28 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-new, port 10024) with ESMTP id 34250-04 for ; Wed, 28 Feb 2007 02:08:26 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from mail63.csoft.net (leary.csoft.net [205.205.214.5]) by postgresql.org (Postfix) with SMTP id 835309FBC4B for ; Wed, 28 Feb 2007 02:08:25 -0400 (AST) Received: (qmail 26689 invoked by uid 1112); 28 Feb 2007 06:08:24 -0000 Date: Wed, 28 Feb 2007 01:08:24 -0500 (EST) From: Kris Jurka X-X-Sender: books@leary.csoft.net To: Stephen Denne cc: pgsql-jdbc@postgresql.org Subject: Re: Minor performance improvements In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.032 tagged_above=0 required=5 tests=AWL, BAYES_50 X-Spam-Level: X-Archive-Number: 200702/154 X-Sequence-Number: 16710 On Tue, 27 Feb 2007, Stephen Denne wrote: > I had a different implementation in mind for Send(byte buf[], int off, > int siz) along the lines of: > I'm not convinced this will be significantly faster, but it is slightly clearer, so I've incorporated it. > Is there a reason for removing pg_input.ensureBytes(siz)? I see you're > checking the length of what was read instead. Is this always equivalent > or sufficient? Does it block in diferent ways? Internally VisibleBufferedInputStream will end up calling ensureBytes in the read call. I don't think the actual read length check is necessary, but it's the sort of thing that could easily break if we changed the VisbibleBufferedInputStream implementation. > When converting ints to bytes, you do not need to mask with 255 (see > int0 to int3 in java.nio.Bits). Yes, removed. > Is it possible other people have code that is calling > ReceiveIntegerR(int siz)? > No, PGStream is an internal only class. Kris Jurka