Replace binary search in fmgr_isbuiltin with a lookup array. Turns out we have enough functions that the binary search is quite noticeable in profiles.
Thus have Gen_fmgrtab.pl build a new mapping from a builtin function's oid to an index in the existing fmgr_builtins array. That keeps the additional memory usage at a reasonable amount. Author: Andres Freund, with input from Tom Lane Discussion: https://postgr.es/m/20170914065128.a5sk7z4xde5uy...@alap3.anarazel.de Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/212e6f34d55c910505f87438d878698223d9a617 Modified Files -------------- src/backend/utils/Gen_fmgrtab.pl | 79 +++++++++++++++++++++++++++++++++------- src/backend/utils/Makefile | 2 +- src/backend/utils/fmgr/fmgr.c | 29 ++++++--------- src/include/utils/fmgrtab.h | 11 +++++- 4 files changed, 88 insertions(+), 33 deletions(-) -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers