pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kris Jurka <books@ejurka.com>
To: Stephen Denne <Stephen.Denne@datamail.co.nz>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Minor performance improvements
Date: Wed, 28 Feb 2007 01:08:24 -0500 (EST)
Message-ID: <Pine.BSO.4.64.0702280104180.7285@leary.csoft.net> (raw)
In-Reply-To: <F0238EBA67824444BC1CB4700960CB485750FF@dmpeints002.isotach.com>
References: <F0238EBA67824444BC1CB4700960CB4802540178@dmpeints002.isotach.com>
	<Pine.BSO.4.64.0702262316480.1687@leary.csoft.net>
	<Pine.BSO.4.64.0702270319360.11284@leary.csoft.net>
	<F0238EBA67824444BC1CB4700960CB485750FF@dmpeints002.isotach.com>



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



view thread (11+ messages)  latest in thread

Message-ID: <Pine.BSO.4.64.0702280104180.7285@leary.csoft.net>
Permalink:  ../Pine.BSO.4.64.0702280104180.7285@leary.csoft.net/
Also on:    postgresql.org/message-id/Pine.BSO.4.64.0702280104180.7285@leary.csoft.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: books@ejurka.com, Stephen.Denne@datamail.co.nz
  Subject: Re: Minor performance improvements
  In-Reply-To: <Pine.BSO.4.64.0702280104180.7285@leary.csoft.net>
  References: <F0238EBA67824444BC1CB4700960CB4802540178@dmpeints002.isotach.com> <Pine.BSO.4.64.0702262316480.1687@leary.csoft.net> <Pine.BSO.4.64.0702270319360.11284@leary.csoft.net> <F0238EBA67824444BC1CB4700960CB485750FF@dmpeints002.isotach.com> <Pine.BSO.4.64.0702280104180.7285@leary.csoft.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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