Re: Performance problem in aset.c
Bruce Momjian <pgman@candle.pha.pa.us>
From: Bruce Momjian <pgman@candle.pha.pa.us>
To: Philip Warner <pjw@rhyme.com.au>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, Jan Wieck <JanWieck@Yahoo.com>, Karel Zak <zakkr@zf.jcu.cz>, pgsql-hackers@postgreSQL.org
Date: 2000-07-12T13:12:04Z
Lists: 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. Sounds like the BSD malloc memory manager. I can post details, or the pages from a kernel book I have about it. -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 853-3000 + If your life is a hard drive, | 830 Blythe Avenue + Christ can be your backup. | Drexel Hill, Pennsylvania 19026