Re: Performance problem in aset.c

Поиск
Список
Период
Сортировка
От Philip Warner
Тема Re: Performance problem in aset.c
Дата
Msg-id 3.0.5.32.20000712142008.01e0fc20@mail.rhyme.com.au
обсуждение исходный текст
Ответ на Performance problem in aset.c  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Performance problem in aset.c  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Performance problem in aset.c  (Bruce Momjian <pgman@candle.pha.pa.us>)
Список pgsql-hackers
At 23:48 11/07/00 -0400, Tom Lane wrote:
>Another idea is to split the returned chunk and put the wasted part back
>as a smaller free chunk, but I don't think this solves the problem; it
>just means that the wasted space ends up on a small-chunk freelist, not
>that you can actually do anything with it.  But maybe someone can figure
>out a variant that works better.

Can you maintain one free list for each power of 2 (which it might already
be doing by the look of it), and always allocate the max size for the list.
Then when you want a 10k chunk, you get a 16k chunk, but you know from the
request size which list to go to, and anything on the list will satisfy the
requirement.

In the absolute worst case this will double your memory consumption, and on
average should only use 50% more memory. If this worries you, then maintain
twice as many lists and halve the wastage. 

The process of finding the right list is just a matter of examining the MSB
of the chunk size. If you want twice the number of lists, then look at the
top two bits etc.




----------------------------------------------------------------
Philip Warner                    |     __---_____
Albatross Consulting Pty. Ltd.   |----/       -  \
(A.C.N. 008 659 498)             |          /(@)   ______---_
Tel: (+61) 0500 83 82 81         |                 _________  \
Fax: (+61) 0500 83 82 82         |                 ___________ |
Http://www.rhyme.com.au          |                /           \|                                |    --________--
PGP key available upon request,  |  /
and from pgp5.ai.mit.edu:11371   |/


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: Connection pooling.
Следующее
От: M.Feldtmann@t-online.de (Marten Feldtmann)
Дата:
Сообщение: Re: Alternative new libpq interface.