Re: faster version of AllocSetFreeIndex for x86 architecture - Mailing list pgsql-hackers

From Jeremy Kerr
Subject Re: faster version of AllocSetFreeIndex for x86 architecture
Date
Msg-id 200906030139.52998.jk@ozlabs.org
Whole thread Raw
In response to faster version of AllocSetFreeIndex for x86 architecture  (Atsushi Ogawa <a_ogawa@hi-ho.ne.jp>)
Responses [PATCH 1/2] Add bit operations util header
[PATCH 2/2] Use fls() to find chunk set
List pgsql-hackers
Hi,

> I made a faster version of AllocSetFreeIndex for x86 architecture.

Neat, I have a version for PowerPC too.

In order to prevent writing multiple copies of AllocSetFreeIndex, I 
propose that we add a fls() function ("find last set"); this can be 
defined in an architecture-independent manner (ie, shift mask & test in 
a loop), and re-defined for arches that have faster ways of doing the 
same (ie, cntlz instruction on powerpc).

We can then change AllocSetFreeIndex to use fls().

Patches coming...



Jeremy


pgsql-hackers by date:

Previous
From: Marko Kreen
Date:
Subject: Re: PostgreSQL Developer meeting minutes up
Next
From: Tom Lane
Date:
Subject: Managing multiple branches in git