From owner-freebsd-hackers Tue Oct 22 11: 8:37 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A0FE437B401 for ; Tue, 22 Oct 2002 11:08:35 -0700 (PDT) Received: from odin.ac.hmc.edu (Odin.AC.HMC.Edu [134.173.32.75]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1274343E65 for ; Tue, 22 Oct 2002 11:08:35 -0700 (PDT) (envelope-from brdavis@odin.ac.hmc.edu) Received: from odin.ac.hmc.edu (IDENT:brdavis@localhost.localdomain [127.0.0.1]) by odin.ac.hmc.edu (8.12.3/8.12.3) with ESMTP id g9MI1xs7019055; Tue, 22 Oct 2002 11:01:59 -0700 Received: (from brdavis@localhost) by odin.ac.hmc.edu (8.12.3/8.12.3/Submit) id g9MI1xeg019054; Tue, 22 Oct 2002 11:01:59 -0700 Date: Tue, 22 Oct 2002 11:01:59 -0700 From: Brooks Davis To: Terry Lambert Cc: Danny Braniss , Poul-Henning Kamp , freebsd-hackers@FreeBSD.ORG Subject: Re: malloc Message-ID: <20021022110159.A1513@Odin.AC.HMC.Edu> References: <3DB50A5A.F87EDA78@mindspring.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-md5; protocol="application/pgp-signature"; boundary="zYM0uCDKw75PZbzx" Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <3DB50A5A.F87EDA78@mindspring.com>; from tlambert2@mindspring.com on Tue, Oct 22, 2002 at 01:20:42AM -0700 X-Virus-Scanned: by amavisd-milter (http://amavis.org/) on odin.ac.hmc.edu Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --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