Skip site navigation (1) Skip section navigation (2)

Re: Performance tweaks

From: Oliver Jowett <oliver(at)opencloud(dot)com>
To: Ken Geis <kgeis(at)speakeasy(dot)net>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Performance tweaks
Date: 2005-02-22 22:16:48
Message-ID: 421BAF50.3020701@opencloud.com (view raw or flat)
Thread:
Lists: pgsql-jdbc
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

In response to

Responses

pgsql-jdbc by date

Next:From: Oliver JowettDate: 2005-02-22 22:36:59
Subject: Re: Performance tweaks
Previous:From: Oliver JowettDate: 2005-02-22 22:00:15
Subject: Re: Performance tweaks

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group