Don't allocate IndexAmRoutine dynamically? - Mailing list pgsql-hackers

From Andres Freund
Subject Don't allocate IndexAmRoutine dynamically?
Date
Msg-id 20190625185011.k3znyh52nm2vck7s@alap3.anarazel.de
Whole thread Raw
Responses Re: Don't allocate IndexAmRoutine dynamically?
List pgsql-hackers
Hi,

I think it might be worthwhile require that IndexAmRoutine returned by
amhandler are allocated statically. Right now we copy them into
local/cache memory contexts. That's not free and reduces branch/jump
target prediction rates.  For tableam we did the same, and that was
actually measurable.

It seems to me like there's not that many index AMs out there, so
changing the signature of amhandler() to require returning a const
pointer to a const object ought to both be enough of a warning, and not
too big a burden.

Comments?

Greetings,

Andres Freund



pgsql-hackers by date:

Previous
From: Ashwin Agrawal
Date:
Subject: Re: errbacktrace
Next
From: Peter Geoghegan
Date:
Subject: Re: [PATCH] Incremental sort (was: PoC: Partial sort)