This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: malloc


> blackdragon@tyler.net writes:
> 
> > why is malloc so bloody slow? some programs (including perl) carry their
> > own malloc to evade this
> 
> The malloc in glibc is not slow.  It has a number of features:
> - thread safe
> - allows debugging
> - has internal checks

All true, but you forgot the most important feature:

- extremely memory-efficient, i.e. low fragmentation

The malloc in Perl is indeed the fastest malloc I know.
Unfortunately, it rounds allocated sizes to the next power of two in
many cases.  For a general purpose allocator, this is not really
acceptable as it wastes _lots_ of memory.

> But what I'm most interested in is actually data where glibc's malloc
> is really slow.  Please show us an example, otherwise any such
> discussion is void,

Indeed.

Regards,
Wolfram.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]