Don't allocate IndexAmRoutine dynamically?

From: Andres Freund <andres(at)anarazel(dot)de>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Don't allocate IndexAmRoutine dynamically?
Date: 2019-06-25 18:50:11
Message-ID: 20190625185011.k3znyh52nm2vck7s@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2019-06-25 19:13:01 Re: [PATCH] Incremental sort (was: PoC: Partial sort)
Previous Message Ashwin Agrawal 2019-06-25 18:45:23 Re: errbacktrace