Re: Binary search in fmgr_isbuiltin() is a bottleneck.

From: Andres Freund <andres(at)anarazel(dot)de>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Jeevan Ladhe <jeevan(dot)ladhe(at)enterprisedb(dot)com>, PostgreSQL Developers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Binary search in fmgr_isbuiltin() is a bottleneck.
Date: 2017-09-28 21:48:45
Message-ID: 20170928214845.3nrcgdvrtbkzm5uv@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2017-09-27 15:50:05 -0400, Tom Lane wrote:
> ISTM it shouldn't be that hard to get Gen_fmgrtab.pl to emit an index
> array of the sort we're talking about, along with the FmgrBuiltin array
> it already prints out. I'm the world's worst Perl programmer but
> I'm happy to take a stab at it if you don't want to.

I might be worse than you... But anyway, here's a patch doing
so. Looking at profiles, it turned out that having the integer limits as
extern variables in a different TU isn't a great idea. So I moved what
used to be fmgrtab.c to fmgrtab.h, and included it directly in fmgr.c.

Is this roughly what you were thinking of?

Greetings,

Andres Freund

Attachment Content-Type Size
0001-Speed-up-fmgr_isbuiltin-by-keeping-an-oid-builtin-ma.patch text/x-diff 12.5 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2017-09-28 22:09:38 Re: [COMMITTERS] pgsql: Fix freezing of a dead HOT-updated tuple
Previous Message Peter Geoghegan 2017-09-28 21:47:30 Re: [COMMITTERS] pgsql: Fix freezing of a dead HOT-updated tuple