pgsql: Speed up AllocSetFreeIndex, which is a significant cost in palloc

From: tgl(at)postgresql(dot)org (Tom Lane)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Speed up AllocSetFreeIndex, which is a significant cost in palloc
Date: 2009-07-21 19:53:12
Message-ID: 20090721195312.207CA75331E@cvs.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Log Message:
-----------
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.

Modified Files:
--------------
pgsql/src/backend/utils/mmgr:
aset.c (r1.79 -> r1.80)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/mmgr/aset.c?r1=1.79&r2=1.80)

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Eisentraut 2009-07-21 20:24:51 pgsql: Change pg_listener attribute number constants to match the usual
Previous Message Peter Eisentraut 2009-07-21 19:21:02 pgsql: Remove translated FAQs The English FAQ has been moved to the