From owner-freebsd-current Thu Mar 14 1:58: 7 2002 Delivered-To: freebsd-current@freebsd.org Received: from hal-4.inet.it (hal-4.inet.it [213.92.5.23]) by hub.freebsd.org (Postfix) with ESMTP id 76E0C37B416 for ; Thu, 14 Mar 2002 01:58:03 -0800 (PST) Received: (from root@localhost) by hal-4.inet.it (8.11.1/8.11.1) id g2E9w2s305558 for ; Thu, 14 Mar 2002 10:58:02 +0100 Received: from acampi.inet.it(213.92.1.165) by hal-4.inet.it via I-SMTP-4.0.5-100 id s-213.92.1.165-9SSCnt; Thu Mar 14 10:58:02 2002 Received: from webcom.it (brian.inet.it [213.92.1.190]) by acampi.inet.it (Postfix) with SMTP id 26ADD15537 for ; Thu, 14 Mar 2002 10:58:02 +0100 (CET) Received: (qmail 5597 invoked by uid 1000); 14 Mar 2002 08:36:03 -0000 Date: Thu, 14 Mar 2002 09:36:03 +0100 From: Andrea Campi To: John Indra Cc: freebsd-current@FreeBSD.ORG Subject: Re: malloc() and the stock Perl in -CURRENT (and -STABLE) Message-ID: <20020314083602.GA821@webcom.it> References: <20020313222518.J27616@nexus.root.com> <41161.1016088004@critter.freebsd.dk> <20020314151502.G8244@office.naver.co.id> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20020314151502.G8244@office.naver.co.id> User-Agent: Mutt/1.3.27i X-Echelon: BND CIA NSA Mossad KGB MI6 IRA detonator nuclear assault strike Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Hi John, On Thu, Mar 14, 2002 at 03:15:02PM +0700, John Indra wrote: > On Thu, Mar 14, 2002 at 07:40:04AM +0100, Poul-Henning Kamp wrote: [...] > This is not just talking about benchmarks. This situation will probably make > people conclude things that are not beneficial at all for FreeBSD. People in > my definition are non-C-coders and those-who-just-like-to-generalize-things. > Exclude me from that list, but there are many of others who fit to that > group. You have to realize that incompetent programmers will always find a way to hog a system down. When you write any piece of software, you have to make tradeoffs, which must be in favor of the most common usage. You can't expect FreeBSD to be optimized for a degenerate loop. Now, your point is that, this is just a simple benchmark but even real apps show slowdowns. This point is moot, IMHO: it simply goes to show that their author, no matter how widely known or experienced are, are doing something silly. There are endless examples of bad programming practice in the free software community (go have a look at some code from Crispin - and teach him what strcmp is for!). And if you wrote the code yourself, you might take the hint that something might be wrong in your code, not the OS. In this particular case, optimization is particularly simple - pre-extend the $result string to the maximum size you expect you'll be (reasonably) using. This results in a run time of 13 seconds on my lowly laptop. The problem is that people often think that programming in Perl (or Java, or Visual C++, take your pick) means you don't need to know what goes on under the hood. This is simply not true. The fact the Linux seems to behave better under some degenerate circustances is non-conclusive at best - each software writer gets to pick what they optimize, like in people optimizing for benchmarks etc. Bye, Andrea -- If Bill Gates had a dime for every time a Windows box crashed... ...Oh, wait a minute, he already does. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message