Speed up PostgreSQL logical decoding plugin
See this comment from fmgr.h:

/* These are for invocation of a function identified by OID with a
 * directly-computed parameter list.  Note that neither arguments nor result
 * are allowed to be NULL.  These are essentially fmgr_info() followed by
 * FunctionCallN().  If the same function is to be invoked repeatedly, do the
 * fmgr_info() once and then use FunctionCallN().
 */

extern Datum OidFunctionCall0Coll ...


This should be way cheaper than SPI.