Re: Avoid stack frame setup in performance critical routines using tail calls

David Rowley <dgrowleyml@gmail.com>

From: David Rowley <dgrowleyml@gmail.com>
To: Andres Freund <andres@anarazel.de>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>, Robert Haas <robertmhaas@gmail.com>, Michael Paquier <michael.paquier@gmail.com>, Tomas Vondra <tv@fuzzy.cz>
Date: 2021-07-20T06:53:39Z
Lists: pgsql-hackers

Attachments

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

Commits

  1. Optimize GenerationAlloc() and SlabAlloc()

  2. Refactor AllocSetAlloc(), separating hot and cold paths

  3. Adjust memory allocation functions to allow sibling calls