Speed up AllocSetFreeIndex, which is a significant cost in palloc and pfree,

Tom Lane <tgl@sss.pgh.pa.us>

Commit: ab5b4e2f9ede250bd77d09aa8ec60bfeb982fb01
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2009-07-21T19:53:12Z
Releases: 9.0.0
Speed up AllocSetFreeIndex, which is a significant cost in palloc and pfree,
by using a lookup table instead of a naive shift-and-count loop.  Based on
code originally posted by Sean Eron Anderson at
http://graphics.stanford.edu/%7eseander/bithacks.html.
Greg Stark did the research and benchmarking to show that this is what
we should use.  Jeremy Kerr first noticed that this is a hotspot that
could be optimized, though we ended up not using his suggestion of
platform-specific bit-searching code.

Files

PathChange+/−
src/backend/utils/mmgr/aset.c modified +32 −9