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

next in thread | previous in thread | raw e-mail | index | archive | help

--zYM0uCDKw75PZbzx
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

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.

-- Brooks

--=20
Any statement of the form "X is the one, true Y" is FALSE.
PGP fingerprint 655D 519C 26A7 82E7 2529  9BF0 5D8E 8BE9 F238 1AD4

--zYM0uCDKw75PZbzx
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE9tZKWXY6L6fI4GtQRArfPAJ91KLcQ/5wMMrv0mP9mlM8QkpItZgCg3g5w
0yugeTHcq6U5+BHyfqv2YL0=
=TgMp
-----END PGP SIGNATURE-----

--zYM0uCDKw75PZbzx--

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?20021022110159.A1513>