Subject: Re: Performance Problem: malloc() is calling madvise()
To: Bill Dorsey <dorsey@lila.com>
From: Simon Burge <simonb@netbsd.org>
List: current-users
Date: 05/21/2000 01:06:58
"Bill Dorsey" wrote:

> The performance figures I gave earlier with my C++ application
> may not have been realistic as I ran it on a very small
> problem set (it takes a long time to run on the full problem
> set).  I reconfigured it to run on the full problem set but
> set it to stop after completing only 1/32 of the work.  This
> allowed me to run it in a reasonable amount of time but get
> realistic memory usage from it.  Below is a table listing the
> performance figures I get with libc.so from 1.4.2_Alpha and
> from 1.4Y (on a DEC Personal Workstation):
> 
> Library         Options                 Run time
> libc.so.61      MALLOC_OPTIONS=""       38.229u 61.542s
> libc.so.61      MALLOC_OPTIONS="h"      32.475u  0.048s
> libc.so.40      MALLOC_OPTIONS=""       29.716u  0.043s

Can you test your application on -current with a 1.4.2 malloc?  This may
be as simple as grabbing the malloc.c from 1.4.2 and adding it to your
program's sources.

> The changes in libc.so.61 (after setting MALLOC_OPTIONS to "h")
> still impact my performance by -9% or so.  I realize that this
> may be offset by increased performance in other applications,
> so this could be a non-issue.  Still, it would be nice to know
> that this was done cogently and not as the by-product of some
> other change.

When the new malloc was introduced, it was noted that it handled memory
usage better and was faster too.  That was when the madvise() call did
nothing...

Simon.