]> granicus.if.org Git - postgresql/commit
Speed up AllocSetFreeIndex, which is a significant cost in palloc and pfree,
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 21 Jul 2009 19:53:12 +0000 (19:53 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 21 Jul 2009 19:53:12 +0000 (19:53 +0000)
commitab5b4e2f9ede250bd77d09aa8ec60bfeb982fb01
tree4ca18782a0d367a3b9ae96ed3d1927843bafd60c
parentf3f45c87d23b800913fb8ea88fe2d713f6b9dd74
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.
src/backend/utils/mmgr/aset.c