[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: malloc is slow

From: Wolfram Gloger
Subject: Re: malloc is slow
Date: 20 Oct 2002 11:53:44 -0000

> I'm writing a scheme interpreter, developping on Debian/GNUlinux. I
> found that the malloc and friends function are slow on my system.

Not in general though..

> My system is a debian unstable, glibc-2.2.5.
> I tried to link my interpreter with DL malloc version 2.7.2 too. I
> wrote several benches both running with the glibc malloc and the
> dlmalloc. This is the time I obtained with one, the time got with the
> other are pretty representative. In this bench, ~ 1.5sec is spend
> doing a loop and some other junk, the rest is pure play with
> allocation.
>               REAL            USER            SYSTEM
> --------------------------------------------------------
> GLIBC-2.2.5   0m25.927s       0m25.860s       0m0.050s
> DLMALLOC-2.7.2        0m6.360s        0m6.240s        0m0.060s
> >From this, I deduce that the malloc from glibc is at least 4 times
> less efficient than the dl malloc. Is this something expected or do I
> something wrong ?

That shows that 2.7.2 is perhaps 4 times faster, _but only in this
particular case_, not in general.  You will also be able to find cases
where 2.7.2 is slower than the previous version.

Anyway, the new glibc version 2.3 does already contain a version of
Doug Lea's 2.7.x malloc, so hopefully you should see the speedup when
Debian adopts glibc-2.3 (probably quite soon).


reply via email to

[Prev in Thread] Current Thread [Next in Thread]