From: | Neil Conway <nconway(at)klamath(dot)dyndns(dot)org> |
---|---|
To: | pgsql-patches(at)postgresql(dot)org |
Subject: | make BufferGetBlockNumber() a macro |
Date: | 2002-04-01 21:13:53 |
Message-ID: | 20020401161353.6f33cfda.nconway@klamath.dyndns.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-patches |
The attached patch re-implements BufferGetBlockNumber() as a macro,
for performance reasons. It also adds an assertion that should probably
be present.
I ran into this while profiling the hash index creation code (and
trying to determine why it's so slow). I noticed that this simple
function was being called about 2,500,000 times while creating a hash
index on a reasonably sized table (225,000 rows). By implementing this
as a macro, the performance of hash index creation improves by 8% (in
a totally unscientific and probably unreliable benchmark).
Cheers,
Neil
--
Neil Conway <neilconway(at)rogers(dot)com>
PGP Key ID: DB3C29FC
Attachment | Content-Type | Size |
---|---|---|
block_macro.patch | application/octet-stream | 2.9 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2002-04-01 22:59:06 | Re: make BufferGetBlockNumber() a macro |
Previous Message | Neil Conway | 2002-04-01 19:30:18 | ALTER TABLE ... RENAME: minor stuff |