Skip site navigation (1) Skip section navigation (2)

pgsql: Improve aset.c's space management in contexts with smallmaxBloc

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Improve aset.c's space management in contexts with smallmaxBloc
Date: 2011-05-02 16:08:24
Message-ID: E1QGvfc-0004z7-Bq@gemulon.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-committers
Improve aset.c's space management in contexts with small maxBlockSize.

The previous coding would allow requests up to half of maxBlockSize to be
treated as "chunks", but when that actually did happen, we'd waste nearly
half of the space in the malloc block containing the chunk, if no smaller
requests came along to fill it.  Avoid this scenario by limiting the
maximum size of a chunk to 1/8th maxBlockSize, so that we can waste no more
than 1/8th of the allocated space.  This will not change the behavior at
all for the default context size parameters (with large maxBlockSize),
but it will change the behavior when using ALLOCSET_SMALL_MAXSIZE.

In particular, there's no longer a need for spell.c to be overly concerned
about the request size parameters it uses, so remove a rather unhelpful
comment about that.

Merlin Moncure, per an idea of Tom Lane's

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/6755558b92748287e961fed518c14be375630464

Modified Files
--------------
src/backend/tsearch/spell.c   |    2 +-
src/backend/utils/mmgr/aset.c |   25 +++++++++++++++++--------
2 files changed, 18 insertions(+), 9 deletions(-)

pgsql-committers by date

Next:From: Peter EisentrautDate: 2011-05-02 16:21:25
Subject: pgsql: Small cleanup of spacing in verbatim DocBook elements
Previous:From: pgsqlDate: 2011-05-02 15:17:10
Subject: pgsql: Tag refs/tags/REL9_1_BETA1 was created

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group