Re: Avoid stack frame setup in performance critical routines using tail calls - Mailing list pgsql-hackers

From Andres Freund
Subject Re: Avoid stack frame setup in performance critical routines using tail calls
Date
Msg-id 189e4a79-c477-44e0-b3a2-e242b491948d@www.fastmail.com
Whole thread Raw
In response to Re: Avoid stack frame setup in performance critical routines using tail calls  (David Rowley <dgrowleyml@gmail.com>)
Responses Re: Avoid stack frame setup in performance critical routines using tail calls  (David Rowley <dgrowleyml@gmail.com>)
List pgsql-hackers
Hi,

On Mon, Jul 19, 2021, at 23:53, David Rowley wrote:
> On Tue, 20 Jul 2021 at 18:17, Andres Freund <andres@anarazel.de> wrote:
> > Any chance you could show a `perf annotate AllocSetAlloc` and `perf annotate
> > palloc` from a patched run? And perhaps how high their percentages of the
> > total work are. E.g. using something like
> > perf report -g none|grep -E 'AllocSetAlloc|palloc|MemoryContextAlloc|pfree'
> 
> Sure. See attached.
> 
> David
> 
> Attachments:
> * AllocateSetAlloc.txt
> * palloc.txt
> * percent.txt

Huh, that's interesting. You have some control flow enforcement stuff turned on (the endbr64). And it looks like it has
anon zero cost (or maybe it's just skid). Did you enable that intentionally? If not, what compiler/version/distro is
it?I think at least on GCC that's -fcf-protection=...
 

Andres



pgsql-hackers by date:

Previous
From: David Rowley
Date:
Subject: Re: Avoid stack frame setup in performance critical routines using tail calls
Next
From: David Rowley
Date:
Subject: Re: Avoid stack frame setup in performance critical routines using tail calls