Re: Add bump memory context type and use it for tuplesorts
David Rowley <dgrowleyml@gmail.com>
From: David Rowley <dgrowleyml@gmail.com>
To: Tomas Vondra <tomas.vondra@enterprisedb.com>
Cc: John Naylor <johncnaylorls@gmail.com>, Matthias van de Meent <boekewurm+postgres@gmail.com>, PostgreSQL Developers <pgsql-hackers@lists.postgresql.org>
Date: 2024-03-11T23:40:59Z
Lists: pgsql-hackers
On Tue, 12 Mar 2024 at 12:25, Tomas Vondra <tomas.vondra@enterprisedb.com> wrote: > (b) slab is considerably slower It would be interesting to modify SlabReset() to, instead of free()ing the blocks, push the first SLAB_MAXIMUM_EMPTY_BLOCKS of them onto the emptyblocks list. That might give us an idea of how much overhead comes from malloc/free. Having something like this as an option when creating a context might be a good idea. generation.c now keeps 1 "freeblock" which currently does not persist during context resets. Some memory context usages might suit having an option like this. Maybe something like the executor's per-tuple context, which perhaps (c|sh)ould be a generation context... However, saying that, I see you measure it to be slightly slower than aset. David
Commits
-
Update mmgr's README to mention BumpContext
- 58cf2e120e8a 17.0 landed
-
Push dedicated BumpBlocks to the tail of the blocks list
- 6d2fd66b9908 17.0 landed
-
Improve test coverage in bump.c
- bea97cd02ebb 17.0 cited
-
Fix incorrect KeeperBlock macro in bump.c
- 705ec0565371 17.0 landed
-
Use bump memory context for tuplesorts
- 6ed83d5fa55c 17.0 landed
-
Introduce a bump memory allocator
- 29f6a959cfd8 17.0 landed
-
Enlarge bit-space for MemoryContextMethodID
- 0ba8b75e7ea6 17.0 landed