Re: Performance problem in aset.c

From: Philip Warner <pjw(at)rhyme(dot)com(dot)au>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Jan Wieck <JanWieck(at)Yahoo(dot)com>, Karel Zak <zakkr(at)zf(dot)jcu(dot)cz>, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: Performance problem in aset.c
Date: 2000-07-12 05:40:38
Message-ID: 3.0.5.32.20000712154038.01ff5de0@mail.rhyme.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

At 01:21 12/07/00 -0400, Tom Lane wrote:
>Philip Warner <pjw(at)rhyme(dot)com(dot)au> writes:
>> 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.
>
>Maybe the right answer is to eliminate the gap between small chunks
>(which basically work as Philip sketches above) and huge chunks (for
>which we fall back on malloc). The problem is with the stuff in
>between, for which we have a kind of half-baked approach...

That sounds good to me.

You *might* want to enable some kind of memory statistics in shared memory
(for a mythical future repoting tool) so you can see how many memory
allocations fall into the 'big chunk' range, and adjust your definition of
'big chunk' appropriately.

----------------------------------------------------------------
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 |/

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2000-07-12 05:52:56 Re: Connection pooling.
Previous Message Alfred Perlstein 2000-07-12 05:35:00 Re: Connection pooling.