From owner-cvs-all Mon Jul 29 9:17:10 2002 Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 15FD937B400; Mon, 29 Jul 2002 09:17:06 -0700 (PDT) Received: from heechee.tobez.org (254.adsl0.ryv.worldonline.dk [213.237.10.254]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2AB0243E5E; Mon, 29 Jul 2002 09:17:05 -0700 (PDT) (envelope-from tobez@tobez.org) Received: by heechee.tobez.org (Postfix, from userid 1001) id 82558AC15; Mon, 29 Jul 2002 18:16:56 +0200 (CEST) Date: Mon, 29 Jul 2002 18:16:56 +0200 From: Anton Berezin To: Mikhail Teterin Cc: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org, phk@FreeBSD.org Subject: Re: perl (5.6.1) and perl-malloc() in the FreeBSD port Message-ID: <20020729161656.GC44660@heechee.tobez.org> References: <200207280914.g6S9EINq064394@freefall.freebsd.org> <200207291210.42191.mi+mx@aldan.algebra.com> <20020723125836.1ce8ed68.Alexander@Leidinger.net> <20020726000942.GI68811@heechee.tobez.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200207291210.42191.mi+mx@aldan.algebra.com> <20020726000942.GI68811@heechee.tobez.org> User-Agent: Mutt/1.5.1i Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Mon, Jul 29, 2002 at 12:10:42PM -0400, Mikhail Teterin wrote: > On Sunday 28 July 2002 05:14 am, Anton Berezin wrote: > = tobez 2002/07/28 02:14:18 PDT > = > = Modified files: > = lang/perl5.8 Makefile pkg-plist > = Log: > = Merge from lang/perl5: > = > = Add two knobs: > = > = WITH_PERL_MALLOC - to compile with perl's own malloc, as opposed > = to the freebsd system malloc. Some might find this useful, since > = perl's malloc is marginally faster in typical cases, and orders > = of magnitude faster in degenerate cases. Use with care. > > Is it not as space-efficient as phk's? Should we consider switching -- > or will the licensing difference make this a non-starter :-) ? Let me answer by citing most of the mail I've written to netchild a couple of days ago: Let me start with some arguments for using perl malloc: 1. Perl malloc is slightly faster for general operations. 2. Perl malloc is orders of magnitude faster in degenerate situations, due to the fact that phkmalloc is not optimized for repeated reallocs. See several threads for the past half year in -stable, -current, and -hackers, if I remember correctly. Now the arguments against using it: 1. Perl malloc does not return memory to the system, as phkmalloc does. This ability of phkmalloc is quite unique and highly valued. One surely does not want all those mod_perlified httpd's to grow any more than they already do. 2. Perl malloc is optimized for 32-bit architectures. According to the release notes, or maybe some other docfile in the 5.8.0 distribution, it is not recommended to use system malloc on such. Since the world in general and FreeBSD in particular seem to be moving towards 64-bit architectures, this is an important point. 3. Severe confusion often results for programs that embed perl compiled with the perl malloc and that insist, either knowingly or by misconfiguration on using system malloc for themselves. Sometimes it works, sometimes it does not. Mod_perl again comes to mind here. As for the item 2 pro perl malloc, first of all, normal perl programs usually do not behave pathologically in this regard. Second, phk has indicated that it would not be particularly difficult, with a little help from the kernel, to optimize multiple realloc of phkmalloc. I think *this* would be the worthy goal to pursue. Cheers, =Anton. -- | Anton Berezin | FreeBSD: The power to serve | | catpipe Systems ApS _ _ |_ | http://www.FreeBSD.org | | tobez@catpipe.net (_(_|| | tobez@FreeBSD.org | | +45 7021 0050 | Private: tobez@tobez.org | To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message