Re^2: Memory Allocation
Niels J|rgen Kruse
njk at freja.diku.dk
Tue May 9 06:52:59 AEST 1989
kpv at ulysses.homer.nj.att.com (Phong Vo[drew]) writes:
>The old malloc was based on a simple first-fit strategy with a roving pointer.
>It is intolerably slow when a process needs to to many mallocs (say thousand
Don't write off roving pointer/rotating freelist allocators
just because of a poor implementation. Rotating freelist
allocators can be made to go *very* fast. That requires an
explicit freelist however.
Even the Bsd 4.1 malloc can be speeded up significantly by
simple means. If there is sufficient interest, i will post a
patch to the Bsd 4.1 malloc (as distributed with the JOVE
sources), that makes it 10 x faster (on my benchmark, your
mileage may vary).
>However, one can go a long way toward making a compromise between having good
>time behavior and good space behavior. Locally, we've been having good
>success with a modified version of the best-fit based algorithm presented
>in that paper.
Could you say how fast it is relative to the Bsd 4.3 malloc,
roughly, < 2 x slower ?, < 3 x slower ?, ...
--
Niels J|rgen Kruse
Email njk at diku.dk
Mail Tustrupvej 7, 2 tv, 2720 Vanlose, Denmark
More information about the Comp.lang.c
mailing list