Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 29 Jul 2002 18:16:56 +0200
From:      Anton Berezin <tobez@FreeBSD.org>
To:        Mikhail Teterin <mi+mx@aldan.algebra.com>
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>
In-Reply-To: <200207291210.42191.mi%2Bmx@aldan.algebra.com> <20020726000942.GI68811@heechee.tobez.org>
References:  <200207280914.g6S9EINq064394@freefall.freebsd.org> <200207291210.42191.mi%2Bmx@aldan.algebra.com> <20020723125836.1ce8ed68.Alexander@Leidinger.net> <20020726000942.GI68811@heechee.tobez.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020729161656.GC44660>