From owner-freebsd-hackers Tue Oct 22 12:38:14 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 7A5A937B401 for ; Tue, 22 Oct 2002 12:38:13 -0700 (PDT) Received: from avocet.mail.pas.earthlink.net (avocet.mail.pas.earthlink.net [207.217.120.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 11C9C43E6E for ; Tue, 22 Oct 2002 12:38:13 -0700 (PDT) (envelope-from tlambert2@mindspring.com) Received: from pool0482.cvx21-bradley.dialup.earthlink.net ([209.179.193.227] helo=mindspring.com) by avocet.mail.pas.earthlink.net with esmtp (Exim 3.33 #1) id 1844qi-0005v6-00; Tue, 22 Oct 2002 12:37:56 -0700 Message-ID: <3DB5A8CC.CB62FE69@mindspring.com> Date: Tue, 22 Oct 2002 12:36:44 -0700 From: Terry Lambert X-Mailer: Mozilla 4.79 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Brooks Davis Cc: Danny Braniss , Poul-Henning Kamp , freebsd-hackers@FreeBSD.ORG Subject: Re: malloc References: <3DB50A5A.F87EDA78@mindspring.com> <20021022110159.A1513@Odin.AC.HMC.Edu> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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 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