Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 22 Oct 2002 12:36:44 -0700
From:      Terry Lambert <tlambert2@mindspring.com>
To:        Brooks Davis <brooks@one-eyed-alien.net>
Cc:        Danny Braniss <danny@cs.huji.ac.il>, Poul-Henning Kamp <phk@critter.freebsd.dk>, freebsd-hackers@FreeBSD.ORG
Subject:   Re: malloc
Message-ID:  <3DB5A8CC.CB62FE69@mindspring.com>
References:  <E183u5Y-0003Yc-00@cse.cs.huji.ac.il> <3DB50A5A.F87EDA78@mindspring.com> <20021022110159.A1513@Odin.AC.HMC.Edu>

next in thread | previous in thread | raw e-mail | index | archive | help
Brooks Davis wrote:
> On Tue, Oct 22, 2002 at 01:20:42AM -0700, Terry Lambert wrote:
> > The FreeBSD malloc would be lower performance than the Linux malloc,
> > if you allocate space in teeny, tiny chunks; it has much higher
> > performance for large allocations.  Good programmers allocate their
> > resources up front, once, instead of doing the allocations in time
> > critical internal loops.
> 
> The user may also see a performance gain on Linux if they use a less
> stupid allocation scheme.  I ran into some code once that read strings
> one character at a time via getc() and did a realloc for each read.
> Needless to say, performance was truly awful since a typical run
> required parsing over 600MB of text.  I saw a better then 50% speedup on
> Alpha Linux when I fixed that mess.

This goes without saying.  It's the difference between programmers
and software engineers.

Nevertheless, there will continue to be a performance differential
between FreeBSD and Linux.  I personally don't think it's a problem;
optimizing that area is optimizing noise.

-- Terry

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3DB5A8CC.CB62FE69>