Re: remove BufferBlockPointers for speed and space

From: Gavin Sherry <swm(at)linuxworld(dot)com(dot)au>
To: Qingqing Zhou <zhouqq(at)cs(dot)toronto(dot)edu>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: remove BufferBlockPointers for speed and space
Date: 2005-08-11 05:43:59
Message-ID: Pine.LNX.4.58.0508111542420.376@linuxworld.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

On Thu, 11 Aug 2005, Qingqing Zhou wrote:

> It is said that the BufferBlockPointers is used to speedup the
> BufferGetBlock() macro. I compared three ways of getting block pointers.
> I.e., existing method (arrary method), calculating block pointer by adding
> base addr and offset*blockid method (mul method) and optimizing mul method
> by using bit shift (shift method). All of them calculate the block pointer
> 80000 times (i.e., the BufferBlockPointers array is of size 80000), and each
> take 3 rounds.
>
> The result is:
>
> SunOS/gcc 3.2
> duration round 1 of array method: 4.179 ms
> duration round 2 of array method: 4.160 ms
> duration round 3 of array method: 4.143 ms
> duration round 1 of mul method: 3.311 ms
> duration round 2 of mul method: 3.233 ms
> duration round 3 of mul method: 3.233 ms
> duration round 1 of shift method: 3.554 ms
> duration round 2 of shift method: 3.235 ms
> duration round 3 of shift method: 3.233 ms
>
> Linux/gcc 3.2
> duration round 1 of array method: 0.422 ms
> duration round 2 of array method: 0.324 ms
> duration round 3 of array method: 0.354 ms
> duration round 1 of mul method: 0.271 ms
> duration round 2 of mul method: 0.248 ms
> duration round 3 of mul method: 0.304 ms
> duration round 1 of shift method: 0.322 ms
> duration round 2 of shift method: 0.239 ms
> duration round 3 of shift method: 0.265 ms
>
> We can conclude that:
> (1) mul or shift are definitely better than array method;
> (2) mul and shift are comparable;

Do you have results for more recent gcc releases?

Thanks,

Gavin

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2005-08-11 06:02:37 Re: remove BufferBlockPointers for speed and space
Previous Message Qingqing Zhou 2005-08-11 05:33:00 remove BufferBlockPointers for speed and space