=?UTF-8?B?QW5kcmV5IEtseWNoa292?= <[email protected]> writes:
>> simple_heap_insert() is used in catalog updates and such. Does that have
>> any measurable performance impact?
> I guess this change doesn't give us an incredible performance increase except
> there will no redundant function call.
> I don't see any reasons against to use the proposed macro instead of this
> function.
Well, by the same token, there's no reason in favor either.
In this particular case I'd vote against because the macro requires
more side-knowledge than the function call, ie GetCurrentCommandId
has to be in-scope for every caller. It's not hard to imagine
future changes that would make that problem worse.
In general, without a clearly measurable performance benefit,
changing functions into macros or inlines isn't a good idea.
The code churn poses hazards for back-patching, and there's
usually some physical code bloat due to more instructions being
needed at each call site.
regards, tom lane